Skip to main content

ASPxTreeList.MoveNode(String, String) Method

Moves the specified node to a new position.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public void MoveNode(
    string nodeKey,
    string parentNodeKey
)

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