Back to Devexpress

ASPxClientTreeList.MoveNode(nodeKey, parentNodeKey) Method

aspnet-js-aspxclienttreelist-dot-movenode-x28-nodekey-parentnodekey-x29.md

latest1.7 KB
Original Source

ASPxClientTreeList.MoveNode(nodeKey, parentNodeKey) Method

Moves the specified node to a new position.

Declaration

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

Parameters

NameTypeDescription
nodeKeystring

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

MoveNode(String, String)

Tree List

ASPxClientTreeList Class

ASPxClientTreeList Members