Stopping drag and drop

Hi, I''d like to prevent any form of drag and drop on the grid. I''ve set AllowDragSelectedCols and AllowDragSelectedRows to false and also tried setting GridOleDataSourceMouseController.HitTestSelectionEdge to 0 and large values, but with no luck. How do I prevent the ''arrow with box'' cursor from appearing? Thanks once again.

3 Replies

AD Administrator Syncfusion Team January 27, 2005 11:28 AM UTC

In the designer, under the ControllerOptions property, uncheck the OleDataSource flag. Or, from code, try //C# this.gridControl1.ControllerOptions = GridControllerOptions.All & (~GridControllerOptions.OleDataSource); ''VB.NET Me.gridControl2.ControllerOptions = GridControllerOptions.All And Not GridControllerOptions.OleDataSource


MW Mike Woolley February 1, 2005 11:30 AM UTC

Thanks. Is it possible to do this on a row-by-row basis, i.e. enable drag and drop from the grid only for the currently selected row?


AD Administrator Syncfusion Team February 1, 2005 12:43 PM UTC

You can try handling QueryCanOleDragRange and cancel it if you do not want to allow the e.Range to be dragged. private void gridControl1_QueryCanOleDragRange(object sender, GridQueryCanOleDragRangeEventArgs e) { if(!(e.Range.IsRows && e.Range.Top == this.gridControl1.CurrentCell.RowIndex && e.Range.Height == 1)) { e.Cancel = true; } }

Loader.
Up arrow icon