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

Dynamically assign text in RadTreeNode

1 Answer 37 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Arsalan
Top achievements
Rank 1
Arsalan asked on 23 Jan 2014, 07:20 AM
hey everyone
i just want to know how to dynamically assign text in radtreenode please help me.. please give me some sample code.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Jan 2014, 08:52 AM
Hi Arsalan,

Please have a look into the following code snippet to change the text of RadTreeNode from client side.

ASPX:
<telerik:RadTreeView ID="RadTreeView1" runat="server">
    <Nodes>
        <telerik:RadTreeNode Text="Item1">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Item2">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Item3">
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>

JavaScript:
<script type="text/javascript">
    function pageLoad() {
        var tree = $find("<%=RadTreeView1.ClientID %>");
        tree.findNodeByText("Item3").set_text("Updated");
    }
</script>

Hope this will helps you.
Thanks,
Shinu.
Tags
Ajax
Asked by
Arsalan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or