Hi all,I am struggling with the following problem.I want to display the amount of subnodes of certain nodes in the tree (Caption (no of nodes)).The tree is constructed manually and uses specialized Nodes derived from UltraTreeNode. I was earching for a NodeAdded event, but couldn't find any. Overriding the OnAddedToCollection method didn't work out, so I am kind of stuck.I do not want to put the logic where I add nodes if possible, so the node should somehow keep track of its subnodes on its own...
Is there anything that will help me there? InitializeDataNode didn't work either...
Any help is kindly appreciated,have a great dayAndy
Hi Andy,
Events exist to tell you when the user did something that you could not otherwise detect. So in this case, there is no event, because the user can't add nodes to the tree - only you can do that. So the only way to do this is to trap wherever in your code you are adding the node(s).
Hi Mike,good hearing from you, I hope you are doing fine.
I mostly agree with your opinion on events and their purpose. On the other hand there are loads of events that serve a general purpose of notifying the application that something happened in general, such as LayoutInitialized or RowInitialized events.In my case the user drags elements (in this case permission and their structures) to the tree and releases them, which causes a new node to be added to the dropnode. So, someone might state that this is indeed a user action that might be worth notifying...I can understand that the classes are not designed to serve this specific purpose, so I'll find a way to work around it. This won't be very hard, so no problem ;)
Thanks for your help and for sharing your thoughts on this topic Mike,it is very much appreciated.
cheers and have a good dayAndy