RadTreeView for ASP.NET

RadTreeView Send comments on this topic.
AllowNodeEditing Property
See Also  Example
Telerik.WebControls Namespace > RadTreeView Class : AllowNodeEditing Property


Gets a value indicating whether the text of the tree nodes are editable in the browser.   

 

Namespace: Telerik.WebControls
Assembly: RadTreeView (in RadTreeView.dll)

Syntax

Visual Basic (Declaration) 
Public Property AllowNodeEditing As Boolean
Visual Basic (Usage)Copy Code
Dim instance As RadTreeView
Dim value As Boolean
 
instance.AllowNodeEditing = value
 
value = instance.AllowNodeEditing
C# 
public bool AllowNodeEditing {get; set;}

Example

Visual BasicCopy Code
<radT:RadTreeView
    ID="RadTree1"
    Runat="server"
    AllowNodeEditing="True"
    OnNodeEdit="HandleNodeEdit"
/>

Protected Sub HandleNodeEdit(ByVal sender As Object, ByVal NodeEvents As RadTreeNodeEventArgs)
    Dim nodeEdited As RadTreeNode = NodeEvents.NodeEdited
    Dim newText As String = NodeEvents.NewText

    nodeEdited.Text = newText
End Sub
C#Copy Code
<radT:RadTreeView
   ID="RadTree1"
   
Runat="server"
   
AllowNodeEditing="True"
   
OnNodeEdit="HandleNodeEdit"
/>

protected void HandleNodeEdit(object sender, RadTreeNodeEventArgs NodeEvents)
{            
   RadTreeNode nodeEdited = NodeEvents.NodeEdited;
   
string newText = NodeEvents.NewText;

   nodeEdited.Text = newText;
}
    

Remarks

End-users can edit the text of tree-nodes by pressing F2 when the node is selected or by clicking on a node that is already selected (slow double click).

You can disable / enable node editing for specific tree nodes by setting the EditEnabled property of the specific RadTreeNode.


After node editing, RadTreeView fires the NodeEdit event and you can change the text of the node - the RadTreeNode instance is contained in the NodeEdited property of the event arguments and the new text is in the NewText property of the event arguments.

Requirements

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also