Back to Devexpress

ASPxTreeList.MoveNode(String, String) Method

aspnet-devexpress-dot-web-dot-aspxtreelist-dot-aspxtreelist-dot-movenode-x28-system-dot-string-system-dot-string-x29.md

latest2.5 KB
Original Source

ASPxTreeList.MoveNode(String, String) Method

Moves the specified node to a new position.

Namespace : DevExpress.Web.ASPxTreeList

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

NuGet Package : DevExpress.Web

Declaration

csharp
public void MoveNode(
    string nodeKey,
    string parentNodeKey
)
vb
Public Sub MoveNode(
    nodeKey As String,
    parentNodeKey As String
)

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(nodeKey, parentNodeKey)

Tree List

ASPxTreeList Class

ASPxTreeList Members

DevExpress.Web.ASPxTreeList Namespace