Knowledgebase
Unifosys > Unifosys Support Help Desk > Knowledgebase

Ask a question:


Node Customization - By Name & By Tag Formatting

Solution

Node Customization - By Name & By Tag Formatting

Question: How to customize (give special formatting to) a particular node or a category of nodes?

Answer: You can access the nodes by the component methods, and can give special formatting to that node or to that category of nodes.

1. Special Formatting For a Node

1- Access the chart node by the unique name given to it (after providing the chart component with data):
HierarchyNode hnd1 = hierarchyWin1.hpcData.Nodes["Node9"];

2- Then change formatting of that node:
hnd1.BackgroundType = BackgroundType.Stock;
hnd1.BackgroundStock = BackgroundTemplate.GreenWall;
hierarchyWin1.Refresh();

3- To access the TreeNode and to change data corresponding to the node:
TreeNode nd = hierarchyWin1.hpcData.Nodes["Node9"].TreeNodes[0];
nd.Text = "NewText";
hierarchyWin1.Refresh();

4- To change the photo corresponding to the node:
You can change nd.ImageIndex or nd.ImageKey
See Pictures in Nodes for more details.

2. Special Formatting For a Category of Nodes

If you set a common tag property (say "Manager") for your special nodes, it will be shown special by the properties set for that Tag.

1- Retrieve a reference to the tag (after providing the chart component with data):
HierarchyNode hnd1 = hierarchyWin1.hpcData.Tags["Manager"];//get reference

2- Then change formatting of that category of nodes:
hnd1.BackgroundType = BackgroundType.Stock;
hnd1.BackgroundStock = BackgroundTemplate.GreenWall;
hierarchyWin1.Refresh();

3- To access the TreeNodes having the tag and to change data corresponding to the nodes:
System.Collections.Generic.List<TreeNode> nodes = hierarchyWin1.hpcData.Tags["Manager"].TreeNodes;
Now, you can access the individual Treenodes and can refresh the chart.

See Database sample (winform) from Samples to see how to use tag based customization.

3. Access Underlying TreeNode of a Specific Chart Node

1- Use NodeByName method:
TreeNode nd = hierarchyWin1.hpcData.NodeByName("Node9");
nd.Text = "NewText";
hierarchyWin1.Refresh();

2- To change the photo corresponding to the node:
You can change nd.ImageIndex or nd.ImageKey
See Pictures in Nodes for more details.

4. Access all Underlying TreeNodes of the Chart

1- Use NodeList property to get a sequential list:
System.Collections.Generic.IList<TreeNode> nodes = hierarchyWin1.hpcData.NodeList;
Now, you can access the individual Treenodes and can refresh the chart.

5. Access Underlying Chart Node Data

1- Use NodesAll property:
HData hd = hierarchyWin1.hpcData.NodesAll[index];
hd.Node.Text = "NewText";
hierarchyWin1.Refresh();

2- To change the photo corresponding to the node:
You can change hd.Node.ImageIndex or hd.Node.ImageKey
See Pictures in Nodes for more details.


See Database sample (winform) from Samples to see how to use tag based customization.
 
Was this article helpful? yes / no
Article details
Article ID: 18
Category: Support Questions
Date added: 17-Jul-2014
Views: 252
Rating (Votes): Article rated 3.5/5.0 (8)

 
<< Go back

© 2013 www.unifosys.com

Powered by Help Desk Software HESK™