Hi!
I want to use GetNodeByKey to find a node in my tree. I use the InitializeDataNode to assign a unique key value to each node (Tree is data bind).
My problem is when I call the GetNodeByKey. It doesn't find my node until I go in debug mode and find it by myself like (Nodes[0].Nodes[1].Key). After I did that with a watch value in the debugger, then the GetNodeByKey returns the node. It acts like if I had to navigate through the nodes first to tell the tree that the node exists. Why does it acts like act ?
I use UltraTree v.10.2.
Best regards,
Benoit
I think at the point when InitializeDataNode is fired, the node has not yet been added to a collection, so you can't use GetNodeByKey in that event.
Sorry I was not very clear in my post. I don't call the GetnodeByKey in the initializeDataNode event. I set the key value in this event, but I call GetNodeByKey later.
I'll explain what I need. I programmed a node double click event to open a new form to edit the data contained in my tree. When I save it, I want to refresh the tree with the updated values. It works fine but because I reload all the data in the tree, I lose the focus on the current node. So I want to keep the key of the node and select it again after I refresh the tree. That's why I want to use GetNodeByKey.
Any ideas ?