Immediate children in a tree view.

2 posts, 0 answers
  1. Nen
    Nen avatar
    7 posts
    Member since:
    Oct 2010

    Posted 21 Oct 2010 Link to this post

    Hi all,

    how do i find the immdiate children of a parent node???, is this supported by telerik?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Oct 2010 Link to this post

    Hello Nen,

    Try the following code snippet to access first child node of a parent node .

    <telerik:RadTreeView ID="RadTreeView1" runat="server">
                   <telerik:RadTreeNode Text="Books">
                           <telerik:RadTreeNode Text="Arts" Expanded="false">
                                   <telerik:RadTreeNode Text="Children's Music" />
                                   <telerik:RadTreeNode Text="Classical" />
                           <telerik:RadTreeNode Text="Biographies" />

    RadTreeNode node = RadTreeView1.FindNodeByText("Books"); // access parent node
    RadTreeNode childNode = node.Nodes[0];// access first child node

    Otherwise, use the following code:


Back to Top