Hi!
We use an UltraTree that uses a DataSet as DataSource (via a BindingSource).
We also use the UltraTree.InitializeDataNode(...) event for setting the node.Key values.
We utilize a call to tree.GetNodeByKey(...) together with the property node.FullPath in order to display the full tree path elsewhere. Unfortunately it seems tree.GetNodeByKey(...) returns Nothing for all nodes that have not yet been expanded in the view.
Appearently only the nodes that are, or have been, expanded have had the InitializeDataNode event called. Can you confirm this behavior?
Can you also suggest a method of "initializing" all node keys of the tree from the start? Is there an easy way to force this or should we do a full traverse of the tree?
Thanks in advance for any help.
-Ulf
Hi Ulf,
That is correct. The tree loads the nodes from the data source on-demand, for efficiency. It would be inefficient to load all of the nodes up-front, since some of those nodes might never be expanded by the user.
If you want to force all of the nodes to get loaded, you could write a recursive loop to simple access the Nodes.Count of each parent node.
Hi Mike,
My problem is that when the treenode is selected as desktop
then the double cilcking on the folder of the desktop is giving the node as null
my code
.explorerUltraTree.GetNodeByKey(C:\Documents and Settings\user_1\Desktop\Folder1);
so my node folder is not opening.
Please suggest the solution
Ok. We figured it was an efficiency-thing.
Thank you very much for the quick response!
Merry Christmas! (Or other applicable appropriate greeting of the season. :-)