Drag-and-Drop
- 2 minutes to read
The GridControl supports native drag-and-drop that allows your end users to:
- Drag and drop records within all view types (Table View, TreeList View, Card View).
- Drag and drop records within Master-Detail Views.
- Drag and drop records between the GridControl and external controls (both DevExpress WPF Controls and Standard WPF Controls).
- Drag and drop records to and from external applications.
Note
- The GridControl‘s data source should implement the IList interface to make built-in drag-and-drop data modifications work correctly.
- The GridControl does not raise the native drag-and-drop events (for example, DragDrop.DragOver, DragDrop.Drop, etc.). Use Drag-and-Drop Options instead.
Enabling Drag-and-Drop
Set the DataViewBase.AllowDragDrop property to true to activate the drag-and-drop functionality. The code sample below demonstrates how to enable drag-and-drop in the TableView:
<dxg:GridControl>
<!---->
<dxg:GridControl.View>
<dxg:TableView AllowDragDrop="True" />
</dxg:GridControl.View>
</dxg:GridControl>
Refer to the How to: Enable Drag-and-Drop in the TableView example for more information.
Note
The GridControl v17.2 and later ships with native drag-and-drop support. Use Drag-and-Drop Managers to enable drag-and-drop functionality in previous versions.
Concepts
-
Lists drag-and-drop options.
Process Drag-and-Drop Operations
How to customize the GridControl’s drag-and-drop functionality.
-
How to customize the drag-and-drop hint.
-
How to customize the drop marker.
-
How to use legacy drag-and-drop managers to enable drag-and-drop.
-
How end users can use drag-and-drop to reorder records within the GridControl.