Hello all,
I have a ultraTree bound to dataSet with up to 5000 nodes. Each node gets a tag object if he gets initialized. The tag object contains some basic properties of the data each nodes stands for.
My search / search next function should find the nodes maching a certain property value, say I'm looking for the node with employee no '9999'.
I have not found any search funktion of ultratree. Only 'GetNodeByKey', but I'm not searching for the. In my first approach I get the key (corresponding to my search property) from the underlying dataset and then called 'GetNodeByKey'.
But 'GetNodeByKey' cannot find nodes not intialized because they not have been expanded so far and 'InitializeDataNode' have not been called yet.
Is there a way to force initializing all nodes without expand all nodes ?
What is the best approach for my find / findNext function ?
Thanks for any help.
Markus
This code looks like it will only affect the root nodes and first level of child nodes, since it's not recursive. That's fine, of course, if you know that you only have 2 levels of nodes.
I don't understand what you mean by "losing the control" or what kind of problem you are having with this code. I don't see anything obviously wrong with it.
Is your tree binding to a data source? If so, then it would be a lot easier to use the InitializeDataNode event instead of looping.
Hi Markus,
You would have to loop through the nodes in the tree recursively and access each node in order to ensure that every node was loaded from the data source. This is pretty easy to do in code, but there's a reason the tree loads the data on-demand - it does this for efficiency. Loading all of the data could cause a performance issue - depending on how much data you need to load and how many levels are in the hierarchy.