New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Using Custom Attributes Declaratively
Custom attributes can be added to a node by simply adding an HTML attribute to a RadTreeNode tag. Then access the attribute in server-side or client-side code. The example below defines a custom "ScientificName" attribute. The attribute is accessed in the server-side NodeClick event through the Attributes property.
ASPNET
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" runat="server" OnNodeClick="RadTreeView1_NodeClick">
<Nodes>
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Red Oak" ScientificName="Quercus rubra">
</telerik:RadTreeNode>
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Eastern Red Cedar"
ScientificName="Juniperus virginiana">
</telerik:RadTreeNode>
<telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Lacebark Elm" ScientificName="Ulmus parvifolia ">
</telerik:RadTreeNode>
</Nodes>
</telerik:RadTreeView>
The custom attribute's name should not be an HTML reserved word . Please see this article for more information.