# Drag and Drop Nodes

This topic discusses about drag and drop operations in TreeView.

## Content

TreeView supports drag and drop operation within the same treeview as well as among multiple treeviews.

To perform drag and drop operation on nodes in a treeView, you need to set the [EnableDragDrop](/componentone/docs/win/online-treeview/) property of [C1TreeView](/componentone/docs/win/online-treeview/) to True. You need to set the **AllowDrop** property provided by **System.Windows.Forms.Control** to True for the treeview on which you need to perform the drop operation. Notice that you need to set the [EnableDragDrop](/componentone/docs/win/online-treeview/) property to True for each of the multiple treeviews to enable drag and drop for them.

The C1TreeView class provides the [ItemDrag](/componentone/docs/win/online-treeview/) event that occurs when a node is dragged. You can handle this event and use the [DraggedData](/componentone/docs/win/online-treeview/) property provided by the [C1TreeViewItemDragEventArgs](/componentone/docs/win/online-treeview/) class to get the dragged data. In addition, you can use the [Nodes](/componentone/docs/win/online-treeview/) property to get the dragged node.

See the following code snippet for reference.

```vbnet
'set the EnableDragDrop property
C1TreeView1.EnableDragDrop = True
'set the AllowDrop property
C1TreeView1.AllowDrop = True
```

```csharp
// set the EnableDragDrop property
c1TreeView1.EnableDragDrop = true;
// set the AllowDrop property
c1TreeView1.AllowDrop = false;
```

### While Dragging

![Dragging nodes](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/dragdrop1.png)

### After Dropping

![Dropped node](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/dragdrop2.png)