Skip to main content

ASPxClientTreeList.MoveNode(nodeKey, parentNodeKey) Method

Moves the specified node to a new position.

Declaration

MoveNode(
    nodeKey: string,
    parentNodeKey: string
): void

Parameters

Name Type Description
nodeKey string

A string value that identifies the target node by its key value.

parentNodeKey string

A string value that identifies the node to whose child collection the target node is moved. An empty string to display the target node within the root.

Remarks

The MoveNode method does nothing if the ASPxTreeList.ParentFieldName property isn’t specified. In this instance, calling the MoveNode method throws an exception.

Calling the MoveNode method raises the ASPxTreeList.ProcessDragNode event. This event allows you to cancel the operation, or to manually process the operation (example: How to: Perform Drag And Drop in Virtual Mode).

Enable the TreeListSettingsEditing.AllowNodeDragDrop option to allow end-users to reorder nodes via drag and drop.

To learn more, see Drag and Drop.

See Also