Unifosys > Unifosys Support Help Desk > Knowledgebase

Ask a question:

Picture in Nodes - Individual Node Photos


Picture in Nodes - Individual Node Photos

Question: How can I put a different photo for each of the nodes? Can I change the picture in the meantime?

Answer: You should prepare an imageList1 in advance (designer), or can create a new imagelist at runtime, and use that imageindex/imagename as below.

Create an ImageList at Desgin-time/Runt-time

hierarchyWin1.hpcSettings.Photo_ImageList4Nodes = imageList1;
//imageList1.Images.Add("Picture1.png"/*optional-to use ImageKey below*/, Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"images\Picture1.png"));

Change Image of a Particular Node

//hierarchyWin1.hpcData.NodesAll[0].Node.ImageIndex = imageList1.Images.Count-1;//the last added one!
hierarchyWin1.hpcData.NodesAll[0].Node.ImageKey = "Picture1.png";//specifically

hierarchyWin1.Refresh();//if required by context (eg: if the call is from other than form load)

Change Photo in Mean-time

You can change the image any time, after loading the data (eg: in a heNodeClick event). Call Refresh to refresh the chart display, in such situations.

More Ways to Access Nodes and Node Data

See Node Based Customization to see more ways to access chart's underlying tree nodes.

See DesignerSample (winform) from Samples to see how to set:
1- Same picture for all nodes.
2- A picture for each level.
3- Individual picture to each of the nodes.
Was this article helpful? yes / no
Article details
Article ID: 19
Category: Support Questions
Date added: 17-Jul-2014
Views: 176
Rating (Votes): Article rated 3.5/5.0 (8)

<< Go back

© 2013

Powered by Help Desk Software HESK™