Skip to main content
All docs
V25.1
  • TreeViewControl.AllowEditing Property

    Gets or sets whether users can edit node values. This is a dependency property.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v25.1.dll

    NuGet Package: DevExpress.Wpf.Grid.Core

    Declaration

    public bool AllowEditing { get; set; }

    Property Value

    Type Default Description
    Boolean false

    true to allow users to edit node values; otherwise, false.

    Remarks

    The TreeViewControl uses an in-place editor that depends on its content.

    Use the EditSettings property to manually define an editor.

    Handle the ValidateNode event to validate new node values.

    Use the ShowingEditor event to prevent the activation of a node’s editor.

    In unbound mode, users cannot edit nodes of simple types (string, integer, etc.). To allow users to edit an unbound tree, set an object as the node’s content.

    public class ProjectObject {
        public string Name { get; set; }
    }
    
    <dxg:TreeViewControl AutoExpandAllNodes="True" TreeViewFieldName="Name" AllowEditing="True">
        <dxg:TreeViewControl.Nodes>
            <dxg:TreeListNode>
                <dxg:TreeListNode.Content>
                    <local:ProjectObject Name="Root Node"/>
                </dxg:TreeListNode.Content>
                <dxg:TreeListNode.Nodes>
                    <dxg:TreeListNode>
                        <dxg:TreeListNode.Content>
                            <local:ProjectObject Name="Level 1"/>
                        </dxg:TreeListNode.Content>
                        <dxg:TreeListNode.Nodes>
                            <dxg:TreeListNode>
                                <dxg:TreeListNode.Content>
                                    <local:ProjectObject Name="Level 2"/>
                                </dxg:TreeListNode.Content>
                            </dxg:TreeListNode>
                        </dxg:TreeListNode.Nodes>
                    </dxg:TreeListNode>
                </dxg:TreeListNode.Nodes>
            </dxg:TreeListNode>
        </dxg:TreeViewControl.Nodes>
    </dxg:TreeViewControl>
    

    For more information, refer to the following help topic: Edit Data.

    See Also