New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Editing Node Text When Using Templates

When using Templates for the Nodes of a RadTreeView, editing of the Text of these Nodes becomes a complicated task.

The approach demonstrated in the example below is an elegant way to edit Node Text, save it in a database and then populate the TreeView with the new data.

Example:

This example shows a TreeView that is bound to a database. It uses Templates for its Nodes. The Template displays the Text of Nodes using the DataBinder.Eval expression.

ASPNET
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" runat="server" AllowNodeEditing="true" OnNodeEdit="RadTreeView1_NodeEdit">
    <NodeTemplate>
        node text:
        <%# DataBinder.Eval(Container.DataItem, "Text") %>
    </NodeTemplate>
</telerik:RadTreeView>
Not finding the help you need?
Contact Support