We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Stopping drag and drop

Thread ID:





24040 Jan 27,2005 11:15 AM UTC Feb 1,2005 12:43 PM UTC WinForms 3
Tags: GridControl
Mike Woolley
Asked On January 27, 2005 11:15 AM UTC

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.

Administrator [Syncfusion]
Replied On 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

Mike Woolley
Replied On 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?

Administrator [Syncfusion]
Replied On 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; } }


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon