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

Tuyrn off range select in Grid

Hi, how can I turn off range select in the GridControl?

Im trying to make my grid so you can only select one whole row, and if you drag the mouse with the button down, it will just change which row is selected

But when the mouse is dragged its just extending the block of selected cells

Thanks


2 Replies

AD Administrator Syncfusion Team March 31, 2008 08:22 PM UTC

Hi Carpii,

To turn off range select in the GridControl you need to handle SelectionChanging event check the reason for raising the event by
use of e.Reson property and if the reson is MouseMove cancel the event.Please refer the below code snippet.

void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if (e.Reason==GridSelectionReason.MouseMove)
e.Cancel = true;
}

Please let me know me know if you need further assistance
Best regards,
Johnson





CA Carpii March 31, 2008 11:42 PM UTC

Thankyou Johnson, thats very useful.
I had already tried with e.cancel, but I was missing the bit how to detect mouse drag

Carpii


Loader.
Live Chat Icon For mobile
Up arrow icon