Drag and Drop
- 2 minutes to read
Enabling end-users to perform drag and drop operations within or between controls can significantly increase the usability of your application. The vertical grid controls (VGridControl and PropertyGridControl) also support drag and drop. You can allow end-users to perform any drag and drop operations either within a grid control or between the grid and external controls.
The list below enumerates the types of drag and drop operations that can be implemented when using a vertical grid and points to topics that contain detailed information about each type.
Automatic row dragging.
Such drag and drop operations are implemented by the vertical grid and don’t require any code to be written. You can be use them to change the position of rows within the control, or to move rows to the Customization Form and back to the control. Please refer to the Using Drag and Drop topic of the end-user Capabilities section for the detailed information on using such operations, including how to disable internal drag and drop.
Manual row dragging using the vertical grid control’s events.
This kind of drag and drop operations implies handling the VGridControlBase.StartDragRow, VGridControlBase.ProcessDragRow and VGridControlBase.EndDragRow events. These events fire when a user begins dragging a row, while the row is being dragged and then when it is dropped. These events can therefore be used to customize row dragging within the control or to allow end-users to drag rows to external controls. Detailed information about these events including examples can be found in Dragging Rows.
OLE Drag and Drop.
This type of drag and drop operations is the most flexible. It gives the capability of dragging any data from the vertical grid to other controls and vice versa. Please refer to the OLE Drag and Drop Overview topic for an overview. Examples of using the VGridControl control as the source or target for drag and drop operations can be found in the XtraVerticalGrid as the Source of Drag and Drop and XtraVerticalGrid as the Target of Drag and Drop topics.