Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
314
Set Key for all nodes in an UltraTree
posted

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

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    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.

Children