This is a migrated thread and some comments may be shown as answers.

Trouble selecting 1st child node

1 Answer 47 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 25 Oct 2010, 05:21 PM
Right Now I am able to load the tree and have the first node (root Node) select automatically, but I want to have it detect if a child of that root node exists and if it does I want to auto select and expand that child node.

Not sure how to get this done?
I expected it to be something like:
If tree.Nodes(0).ChildNode.Count > 0 then
tree.Nodes(0).ChildNode(0).Selected = True
End If

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Oct 2010, 11:35 AM
Hello,

The following code will help you in this.

VB:
If TryCast(RadTreeView1.Nodes(0), RadTreeNode).Nodes.Count > 0 Then
    RadTreeView1.Nodes(0).Nodes(0).Selected = True
End If



-Shinu.
Tags
TreeView
Asked by
Jay
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or