# SetupDragAndDrop(SetupDragAndDropArgs)

> This function is called when TreeView<TIdentifier>.CanStartDrag returns true.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.7/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
protected virtual void SetupDragAndDrop(TreeView<TIdentifier>.SetupDragAndDropArgs args)
```

### Parameters

**** (\[SetupDragAndDropArgs]\(/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview1/setupdraganddropargs)):&#x20;

### Remarks

Override this function to set the global [DragAndDrop](/engine/6000.7/script-reference/unityeditor/draganddrop.md) state and set which items can be dragged and dropped. Use [TreeView\<TIdentifier>.FindRows](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview1/findrows.md) to convert the dragged IDs to TreeViewItems if needed.

You control TreeView drag and drop in the following order:\\

1. override [TreeView\<TIdentifier>.CanStartDrag](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview1/canstartdrag.md) to enable dragging TreeViewItems.\\

2. override [TreeView\<TIdentifier>.SetupDragAndDrop](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview1/setupdraganddrop.md) to set which TreeViewItems are dragged.\\

3. override [TreeView\<TIdentifier>.HandleDragAndDrop](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview1/handledraganddrop.md) to control the drag and drop behavior of the TreeView.\\

Additional Resources: [DragAndDrop](/engine/6000.7/script-reference/unityeditor/draganddrop.md).
