Skip to main content

TcxCustomGridView.DragMode Property

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

Declaration

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) represents a control incorporating 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