Change node text in runtime

4 posts, 0 answers
  1. Bruno
    Bruno avatar
    20 posts
    Member since:
    Sep 2012

    Posted 16 Dec 2011 Link to this post

    Hi all,

    I have a RadTreeView in my app and I need to change a specific node text. I am trying the following: (RadTreeView name: CriteriaTree)

    ((RadTreeNode)CriteriaTree.FindNodeByValue("20")).Text = "Node Text";

    But it's not working.

    Any thoughts?

    Thanks,
    Bruno
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Dec 2011 Link to this post

    Hello,

    Try the following code snippet after setting Value property of RadTreeNode.
    CS:
    protected void Page_Load(object sender, EventArgs e)
     {
        RadTreeView1.FindNodeByValue("1").Text = "ParentNode";
     }

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bruno
    Bruno avatar
    20 posts
    Member since:
    Sep 2012

    Posted 19 Dec 2011 Link to this post

    Thank you for your post. I try that but it is not working.

    Rgds
    Bruno
  5. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 19 Dec 2011 Link to this post

    Hello Bruno,

    Both expressions should work fine.

    Are you setting the Value property of the nodes correctly? Perhaps you want to search by the node's text, in which case you have to use the FindNodeByText function.

    If that isn't the case, please send the code for the page where you are trying to access the node.

    Best wishes,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top