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

Index of a child note

1 Answer 38 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mehrdad
Top achievements
Rank 1
Mehrdad asked on 09 Mar 2009, 11:37 AM
Hi,
How can I find out index of the selected node in the childeren of anothr node?
I have  a tree a root and others are childeren. I want to find the index of the selected childeren

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Mar 2009, 06:40 AM
Hello Mehrdad,

Try the following code snippet to find out the index of selected node in RadTreeView.

CS:
protected void Button2_Click(object sender, EventArgs e)  
{  
    if (RadTreeView1.SelectedNodes.Count>0) // Checking whether, node is selected  
    {  
        int index = RadTreeView1.SelectedNode.Index; //Get the Index  
        int level = RadTreeView1.SelectedNode.Level; // Get the level  
    }  

I hope the link to online documentation which explains about Working with Nodes in Server-Side Code will help you.

Thanks,
Princy.
Tags
TreeView
Asked by
Mehrdad
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or