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.
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.
TreeView, by default, uses a textbox editor for editing nodes. You can, however, replace the default editor with a custom editor, whenever needed. You can specify a custom editor for nodes for each column by using the Editor property of C1TreeColumn. In addition, you can set the type of the node editor by setting the EditorType property from the C1TreeViewEditorType enum.
The following image displays both the default textbox and the custom textbox editor.
The following code snippet creates a class EditorsData that provides sample data for the editors.
The following code snippet creates a class CustomTextBox to create a custom textbox editor on the basis of the default textbox editor.
The following code snippet sets the default textbox and the custom textbox as editors in the first and the second columns, respectively.