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

Retrieve a path's value

4 Answers 93 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 28 Jun 2008, 02:42 PM
Hello,
my colleague asks me that if TreeView control reveals API to retrieve the values of nodes from root node to a leaf node (i.e., a path) ?

Cheer for your reply.

Ricky.

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 29 Jun 2008, 03:18 PM
Hi Ricky,

You can use the RadTreeNode.FullPath property to the get the path of a Node at the server.

I hope this helps.

Greetings,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ricky
Top achievements
Rank 1
answered on 30 Jun 2008, 03:07 AM
Thank you.

Ricky.
0
Ricky
Top achievements
Rank 1
answered on 30 Jun 2008, 02:24 PM
Hello, Simon.

My colleague said your solution for retriving the "Text" properties of a path, not the "Value" properties.

Could you give us another workaround?

Regards,
Ricky.
0
Simon
Telerik team
answered on 01 Jul 2008, 12:51 PM
Hello Ricky,

Please consider the following implementation of the GetFullValuePath method:

    private string GetFullValuePath(RadTreeNode node, string delimeter) 
    { 
        StringBuilder valuePath = new StringBuilder(delimeter); 
 
        valuePath.Append(node.Value); 
 
        while (node.ParentNode != null
        { 
            valuePath.Insert(0, node.ParentNode.Value); 
            valuePath.Insert(0, delimeter); 
 
            node = node.ParentNode; 
        } 
 
        return valuePath.ToString(); 
    } 

RadTreeNode does not support such a method so it should be implemented additionally.

I hope this helps.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Ricky
Top achievements
Rank 1
Answers by
Simon
Telerik team
Ricky
Top achievements
Rank 1
Share this question
or