Trouble selecting 1st child node

2 posts, 0 answers
  1. Jay
    Jay avatar
    59 posts
    Member since:
    Apr 2009

    Posted 25 Oct 2010 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Oct 2010 Link to this post

    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.
Back to Top