GridView.DragObjectStart Event
Fires when the end-user attempts to drag a column header or band header.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v21.1.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Grid
Declaration
Event Data
The DragObjectStart event's data class is DragObjectStartEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Allow | Gets or sets whether the drag and drop operation can be started. |
DragObject | Gets the column or band whose header is about to be dragged. |
Remarks
The following events enable you to control column header and band header dragging:
- The DragObjectStart fires when an end-user tries to drag a header. You can handle the event to prevent header dragging. (You can also disable column and band header dragging using the OptionsColumn.AllowMove, OptionsBand.AllowMove and GridOptionsCustomization.AllowColumnMoving options.)
- The GridView.DragObjectOver event fires repeatedly while dragging the object. The event allows you to prevent dropping while over an inappropriate area.
- The GridView.DragObjectDrop fires immediately after a drag and drop operation has been completed. The event serves as a notification only and does not allow you to prevent dropping.
When handling the DragObjectStart event, use the DragObject parameter to identify the column or band whose header is about to be dragged. To prevent a drag and drop operation, set the DragObjectStartEventArgs.Allow parameter to false.
Note: the DragObjectStart event is not raised if dragging is prohibited by the column’s OptionsColumn.AllowMove or the band’s OptionsBand.AllowMove option.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DragObjectStart event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.