Hi.
I replace a classic treeview by an UltraTree.
All seems OK but the events AfterActivate or AfterSelect are not fired if the control is disabled.
The user cannot select a node, but via program I select a specific node and I need the event AfterActivate show some infos.
With the classic Microsoft Treeview this is working, not with UltraTree.
How could I implement this workflow ?
Best regards.
Clauyde
Hello Milko.
I've already used what you suggest and it works perfectly.
I was curious to know if another solution exists or if this problem is a bug.
I will add the layout suspend to be more clean.
Claude
Hello Claude,
Yes, you are correct. By design UltraTree does not allow you to select via UI or through code any nodes if the tree is not Enabled. What you can do to work-around this behavior is Enable the tree, select the node you need to, and disable back the tree. You can use code like this:
this.ultraTree1.Enabled = true;this.ultraTree1.Nodes[1].Selected = true;this.ultraTree1.Enabled = false;
Note, that if you are facing some flickering you can also suspend layout for the tree before you call the above code and resume the layout after.
Please let me know if you have any additional questions on this matter.