TreeList.CopyNodes(IEnumerable<TreeListNode>, TreeListNode, Boolean, Boolean, Int32) Method

Copies the specified nodes to the specified node's child collection. This method does not update the data source and is intended for use in unbound mode.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll


public List<TreeListNode> CopyNodes(
    IEnumerable<TreeListNode> sourceNodes,
    TreeListNode destinationNode,
    bool cloneChildren,
    bool modifySource,
    int position
Public Function CopyNodes(
    sourceNodes As IEnumerable(Of TreeListNode),
    destinationNode As TreeListNode,
    cloneChildren As Boolean,
    modifySource As Boolean,
    position As Integer
) As List(Of TreeListNode)


Name Type Description
sourceNodes IEnumerable<TreeListNode>

A collection of TreeListNode objects representing the nodes to be copied.

destinationNode TreeListNode

A TreeListNode object representing the node to whose child collection the node is copied.

cloneChildren Boolean

true, if child nodes of the node being copied must be cloned; otherwise, false.

modifySource Boolean

true, if the destination node's key field value is assigned to the parent field of the source node and all its copies; otherwise, false.

position Int32

An Int32 value that specifies the position that the moved node occupies within the destination collection.


Type Description

A TreeListNode object representing the copy of the specified node.


Use the CopyNode method to create a copy of the specified node. The copy is added to the child collection of the destination node. Note that a node cannot be copied to another TreeList control. Also note that children of the copied node are not cloned if the node is copied to itself or to its own child even if the cloneChildren parameter is set to true.


This method does not update the data source and is intended for use in unbound mode. In bound mode, use the AppendNode method, or use means of the data source.

See Also