Retrieve a path's value

5 posts, 0 answers
  1. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 28 Jun 2008 Link to this post

    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.
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 29 Jun 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 29 Jun 2008 Link to this post

    Thank you.

    Ricky.
  5. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 30 Jun 2008 Link to this post

    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.
  6. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 01 Jul 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017