TreeList.DoDragDropNodes(IEnumerable<TreeListNode>, DragDropEffects) Method

Allows you to implement drag-and-drop operations between controls on tree list nodes. Begins a drag-and-drop operation, and forces the tree list and target control to raise the events relative to the operation.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll

Declaration

public void DoDragDropNodes(
    IEnumerable<TreeListNode> nodes,
    DragDropEffects effects
)
Public Sub DoDragDropNodes(
    nodes As IEnumerable(Of TreeListNode),
    effects As DragDropEffects
)

Parameters

Name Type Description
nodes IEnumerable<TreeListNode>

The collection of nodes to drag.

effects DragDropEffects

A DragDropEffects enumeration value that specifies the allowed drag effects.

Remarks

The DoDragDropNodes method begins a drag operation, and raises the following events:

of the source control:

  • GiveFeedback - fires during the operation, and allows you to provide feedback to the user based on the mouse cursor location;
  • QueryContinueDrag - fires during the operation, allows you to terminate the operation based on the mouse cursor location;

of the target control:

  • DragEnter - the mouse enters the control;
  • DragLeave - the mouse leaves the control;
  • DragOver - the mouse moves within the control;
  • DragDrop - the operation is completed.

Handling these events allows you to implement drag operations between controls on tree list nodes. The nodes parameter sets the nodes to drag. The effects parameter specifies drag effects, such as move, copy, that are allowed during the operation. These parameters are then passed to the mentioned events where you can handle them.

When the operation terminates (succeeded or canceled), the DoDragDropNodes method returns.

NOTE

To begin a drag-and-drop operation on tree list nodes, use the DoDragDropNodes method rather than the inherited DoDragDrop method.

NOTE

Unlike the DoDragDrop method, the DoDragDropNodes method does not return the final effect that was performed during the drag-and-drop operation.

Before the DoDragDropNodes method starts a drag operation, the TreeList.BeforeDragNode event raises, allowing you to cancel beginning the operation.

See Also