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.v19.2.dll
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:
Library | Object Type | Path to AutoChangeParent |
---|---|---|
WinForms Controls | GanttControl |
|
ResourcesTree |
|
|
TreeList |
|
|
Reporting | XRDesignFieldList |
|
XRDesignReportExplorer |
|
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoChangeParent property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.