Skip to main content

TreeList.SetNodeIndex(TreeListNode, Int32) Method

Moves the specified node to a new position within its parent node’s child collection.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v22.2.dll

NuGet Package: DevExpress.Win.TreeList

Declaration

public void SetNodeIndex(
    TreeListNode node,
    int index
)

Parameters

Name Type Description
node TreeListNode

A TreeListNode object representing the node to be moved.

index Int32

An integer value representing the destination position of the node within its parent node’s child collection.

Remarks

Use the SetNodeIndex method to move the node within the collection of nodes that have the same parent. The destination position of the node is specified by the index parameter. If this parameter value is negative or greater than the number of nodes in the collection, the node is moved to the first or to the last position within the collection respectively.

Note, that calling this method may not actually move the node if sorting is applied to the Tree List control.

See Also