ComponentOne TreeView for WinForms
Editing Nodes
Nodes > Editing Nodes

TreeView enables you to edit nodes in applications, you need to set the AllowEditing property of the C1TreeView class to true. The default value of the property is false.

You can start editing a node by selecting a node and pressing the Enter or F2 key, or simply double-clicking the node itself. In addition, you can edit a node programmatically by calling the BeginEdit method in code. To use any of these modes for editing nodes, you need to set the EditMode property of the C1TreeView class from the C1TreeViewEditMode enum.

Note: If you want to determine whether the contents of a specific node can be changed, you can use the IsReadOnly method of C1TreeNode.

The following image shows a node being edited.

The given code snippet sets the AllowEditing property to allow node editing and specifies the mode of editing.

' set the AllowEditing property
C1TreeView1.AllowEditing = True

' set the EditMode property
C1TreeView1.EditMode = C1.Win.TreeView.C1TreeViewEditMode.EditOnEnter
// set the AllowEditing property
c1TreeView1.AllowEditing = true;

// set the EditMode property
c1TreeView1.EditMode = C1.Win.TreeView.C1TreeViewEditMode.EditOnEnter;