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

How to get the node value ?

5 Answers 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 22 Dec 2008, 11:36 AM
Hi,
    I am at level 3 . How can I get the level 2, level 1 and level 0 value .
I tried with

Convert

.ToInt32(e.Node.Nodes[1].Value);

But is it giving error . Can you please tell me where I am doing  wrong ?

With Thanks & Regads
Manoj

 

5 Answers, 1 is accepted

Sort by
0
Manoj
Top achievements
Rank 1
answered on 22 Dec 2008, 01:26 PM
HI,
    Can anybody help me out .

With Thanks & Regards
Manoj
0
Yana
Telerik team
answered on 22 Dec 2008, 02:59 PM
Hi Manoj,

You should use e.Node.ParentNode.ParentNode.ParentNode.Value to get the value of the root node.

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Manoj
Top achievements
Rank 1
answered on 22 Dec 2008, 03:08 PM
Hi Yana,
    I have 7 level in the tree view . While I will be expanding the level seven node I have to pass the level 6 , level 5 , level 4 , level 3, level 2 , level 1 and level 0 value to my stored procedure . If I will be expanding the level 5 then I have to pass the level 4 , level 3, level 2 , level 1 and level 0 value to my stored procedure . I mean to say that level is not static , it's dynamic .  Tell me whether it will work or not ? Is there any way to get the value of previous level data for the currenty level  ?

With Thanks & Regards
Manoj
0
Yana
Telerik team
answered on 23 Dec 2008, 09:39 AM
Hello Manoj,

You can use e.Node.Level property to find whether you're on level 5 or level 7, also you can determine how many times to call ParentNode to find the root node:

RadTreeNode node = e.Node;  
while (node.Level > 0)  
   node = node.ParentNode; 

Best wishes,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Manoj
Top achievements
Rank 1
answered on 23 Dec 2008, 03:32 PM
Hi Yana,
    Thanks , it's work fine.
With Thanks & Regards
Manoj
Tags
TreeView
Asked by
Manoj
Top achievements
Rank 1
Answers by
Manoj
Top achievements
Rank 1
Yana
Telerik team
Share this question
or