If I use node.sibling is that the node directly under the active node or is it a node further down the branch.
node
node (is this the sibling next) or
node---|
node ( or is this the sibling next) if this isn't the sibling next how do I access it.
Thanks
I'm not sure about the docs, but it is quite a simple functionHere you go!
Private Sub ToggleAllNodes(ByVal State As String, ByRef Node As UltraTreeNode) If (State = "Uncheck") Then Node.CheckedState = CheckState.Unchecked ElseIf (State = "Check") Then Node.CheckedState = CheckState.Checked End If For Each ChildNode As UltraTreeNode In Node.Nodes ToggleAllNodes(State, ChildNode) NextEnd Sub
Ok, any chance there's a code sample in documentation somewhere that shows how to navigate a tree with multiple levels? For example if I wanted to check every node in the tree. I think I can figure it out but a sample would sure make it easy.
Hi morrisd
For clarification, i have labelled the nodes in your example:
morrisd said:If I use node.sibling is that the node directly under the active node or is it a node further down the branch. "node1" "node2" (is this the sibling next) or "node3"---| "node3-1" ( or is this the sibling next) if this isn't the sibling next how do I access it.
"node1"
"node2" (is this the sibling next) or
"node3"---|
"node3-1" ( or is this the sibling next) if this isn't the sibling next how do I access it.
The "siblings" of node1 are node2 and node3. So, node2 is sibling next from node1.To access node3-1, you must get at the "children" of node3. To do this, look at node3's Nodes collection.
You can access any node from any other node, using the node parent, sibling and .Nodes