In our application using the ultratree control we should be able not only to activate but select a treenode programmatically
I tried the simple snippet
treenode.Actived= true; >> ok
treenode.Selected = true; >> nok !
tree.ActiveNode.Selected = true; >> also nok ?
As if it where impossible to do it like this ???
Any idea
Thanks Kagel
Hi Georgi/Mike,
thank that was already helpful:
nod.Selected = true; does nothing (nod is still unselected)
whereas tree.SelecteNode.AddRange(new List<UltraTreeNode>() {nod }); sets the specific nod.Selected = true;
Best regards
Kagel
Hi,
What do you mean by "nok?" What's actually wrong? Are you getting an error message? Or is the node just not selected? If the latter, then how do you know it's not selected? How are you checking to see if the node is selected or not?
Hello Kagel,
To solve your task, you should add your node to SelectedNodes collection. For example:
List<UltraTreeNode> listnode = new List<UltraTreeNode>();
listnode.Add(node1);
listnode.Add(node2);
listnode.Add(node3);
ultraTree1.SelectedNodes.AddRange(listnode, false);
Let me know if you have any questions.