Hi Guys,
I have a UltraTree which loads data for different types of sport items. Following shows how the tree should be displayed:
- Cricket
Cricket1
Cricket1.1
Cricket1.1.1
Cricket1.2
Cricket1.2.1
Cricket2
- FootBall
FootBall1
FootBall1.1
FootBall1.1.1
FootBall1.2
FootBall2
-----------
------------ and Goes on..
I want to set different images for different types. For example, for Cricket and its CHILD nodes ( Cricket1, Cricket1.1, Cricket1.1.1, Cricket2 etc.), should load Cricket image, and for FootBall and its Child Nodes FootBall(FootBall1, FootBall1.1, FootBall1.1.1,FootBall2 etc.) should load FootBall image etc.
I have set some apperenaces and when i try to load the tree using follwing code, it takes a looooong time. Is there a way to overcome this delay and would like to know any different approach i can use to load this images.
private void LoadTree()
{
this.utComponentTree.DataSource = this.componentBindingSource;
componentBindingSource.DataSource = treeVluesTable; // table which has the tree data
aAppearance.Image = 0;
aAppearance.Image = 1;
SetApperance(this.utComponentTree.Nodes[0], utComponentTree.Appearances["Cricket"]);
}
node.Override.NodeAppearance = appearance;
descendants[i].Override.NodeAppearance = appearance;
this.GetAllDescendants(node.Nodes, retVal);
descendants.Add(node);
Urgent Help Needed!! Any questions welcome! Thanks in Advance.
Nw
Thanks for the reply. Will try it and see.
NW
I looked into this once before and it was caused by the use of an ImageList; when an index is specified as the value of the Image property, performance was getting hit through the act of using the indexer. I also looked into why the .NET TreeView control did not seem to have the same problem, and it was because they were using internal methods to get at the ImageList, which are not available to us. The solution was very simple though - instead of assigning (for example) 0 to the Image property, assign a reference to the Image itself, i.e., ImageList.Images[0].