How to control whether OLE Drag-and-Drop is supported in the Grid

15 Jun 20211 minute to read

Whether a grid is an OLE drop target, which is controlled by DragDropTargetFlags in the grids Model.Options class. These flags control things like clipboard format, the type of data, whether columns or rows can be appended to accommodate the dropped data, and whether auto scrolling is supported. Check the enums for GridDragDropFlags to see the full set of options.

//Turns off being a drop target.        
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Disabled; 

//Turns on accepting text. 
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Text;        

//Accepts both text and styles.   
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Text | GridDragDropFlags.Text;
'Turns off being a drop target. 
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Disabled

'Turns on accepting text. 
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Text

'Accepts both text and styles. 
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Text Or GridDragDropFlags.Text