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

Change node text in runtime

3 Answers 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bruno
Top achievements
Rank 1
Bruno asked on 16 Dec 2011, 07:04 PM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Dec 2011, 05:44 AM
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
0
Bruno
Top achievements
Rank 1
answered on 19 Dec 2011, 04:17 PM
Thank you for your post. I try that but it is not working.

Rgds
Bruno
0
Bozhidar
Telerik team
answered on 19 Dec 2011, 06:19 PM
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
Tags
TreeView
Asked by
Bruno
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Bruno
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or