Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomGridView.DragMode Property

Specifies the manner in which Views initiate drag-and-drop operations.

#Declaration

Delphi
property DragMode: TDragMode read; write; default dmManual;

#Property Value

Type Default
TDragMode dmManual

#Remarks

Set the DragMode property to dmAutomatic to start a drag-and-drop operation automatically when a user clicks and drags records within the current View.

When DragMode is set to dmManual, you need to start a drag-and-drop operation manually by handling the View’s OnMouseDown event. dmManual mode gives you more capabilities as you can determine where drag-and-drop should start. For instance, you can enable drag-and-drop only for odd/even records, specific items, etc.

To start drag-and-drop in dmManual mode, use the BeginDrag method of the View’s Site object. The Site object (TcxGridSite class) is a control that embeds a grid View. It receives mouse and keyboard events, which are then passed as messages to the View, and it is responsible for painting the View.

See the OnDragOver and OnDragDrop events to implement the current View’s response to drag-and-drop operations.

The default value of the DragMode property is dmManual.

See Also