Skip to main content

TreeListOptionsBehavior.AutoChangeParent Property

Gets or sets whether the node’s parent field value is automatically set to the key field value of its parent node.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AutoChangeParent { get; set; }

Property Value

Type Default Description
Boolean true

true if the node’s parent field value is automatically set to the key field value of its parent node; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoChangeParent
TreeList
.OptionsBehavior .AutoChangeParent

Remarks

You can enable node drag-and-drop functionality with the TreeListOptionsDragAndDrop.DragNodesMode property.

If the AutoChangeParent option is set to true, the node’s parent field value (TreeList.ParentFieldName) is automatically set to the key field value (TreeList.KeyFieldName) of its new parent node each time the node’s position is changed within the tree.

In bound mode, when the Tree List is associated with an external data source, its nodes can also be removed by deleting their corresponding records (data rows) from the data source. If the AutoChangeParent option is enabled, the child nodes of the removed node are automatically moved to the root nodes collection. Otherwise, if this option is disabled, the child nodes are also removed when their parent node is deleted. The TreeListNodes.Remove method removes the specified node and all its child nodes regardless of the AutoChangeParent option’s value.

See Also