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

Declaration

[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AutoChangeParent { get; set; }
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property AutoChangeParent As Boolean

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:

Library Object Type Path to AutoChangeParent
WinForms Controls GanttControl
.OptionsBehavior.AutoChangeParent
GanttControl
.OptionsBehavior.AutoChangeParent
ResourcesTree
.OptionsBehavior.AutoChangeParent
TreeList
.OptionsBehavior.AutoChangeParent
Reporting XRDesignFieldList
.OptionsBehavior.AutoChangeParent
XRDesignFieldList
.OptionsBehavior.AutoChangeParent
XRDesignReportExplorer
.OptionsBehavior.AutoChangeParent
XRDesignReportExplorer
.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