Dynamically assign text in RadTreeNode

2 posts, 1 answers
  1. Arsalan
    Arsalan avatar
    17 posts
    Member since:
    Sep 2013

    Posted 23 Jan 2014 Link to this post

    hey everyone
    i just want to know how to dynamically assign text in radtreenode please help me.. please give me some sample code.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jan 2014 Link to this post

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