TreeList.MoveNode(TreeListNode, TreeListNode, Boolean, Int32) Method
Moves the TreeListNode specified via the sourceNode parameter to the TreeListNode.Nodes collection of the TreeListNode specified by the destinationNode parameter.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.2.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
#Declaration
public bool MoveNode(
TreeListNode sourceNode,
TreeListNode destinationNode,
bool modifySource,
int position
)
#Parameters
Name | Type | Description |
---|---|---|
source |
Tree |
The moved Tree |
destination |
Tree |
A Tree |
modify |
Boolean | true if the destination node’s key field value is assigned to the parent field of the source node; otherwise false. |
position | Int32 | An Int32 value that specifies the position that the moved node occupies within the destination collection. |
#Returns
Type | Description |
---|---|
Boolean | true, if the source |
#Remarks
If the destinationNode parameter value is null, the sourceNode is moved to the root of the TreeList. Nodes cannot be moved if:
- the sourceNode parameter value is null;
- the sourceNode and the destinationNode parameters represent the same TreeListNode;
- the destinationNode is a child node of the sourceNode.
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MoveNode(TreeListNode, TreeListNode, Boolean, Int32) method.
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.