Skip to main content
A newer version of this page is available. .
All docs
V20.2

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.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, 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>
See Also