Bind CustomAttribute to the TreeView

2 posts, 0 answers
  1. jing
    jing avatar
    31 posts
    Member since:
    Aug 2007

    Posted 05 Aug 2010 Link to this post

    How do I bind the Custom Field to the TreeView Node so that in javascript, I can get "Custom1" and "Custom2" value.

    DataTable tb = new DataTable(); 
    // add item to the datatable 
    TreeView1.DataSource = tb; 


    <telerik:RadTreeView ID="TreeView1" runat="server" Skin="Default" DataFieldID="ID" DataFieldParentID="ParentID" DataTextField="Name">
            <telerik:RadTreeNodeBinding Expanded="True" TextField="Name" ValueField="ID" />

    Thanks in advance.
  2. Yana
    Yana avatar
    4907 posts

    Posted 06 Aug 2010 Link to this post

    Hi jing,

    You should use NodeDataBound event to bind the custom attributes to a node as shown here. You can also check this help article which demonstrates how to set the attributes on the server.

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top