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

How do I detect GridRangeInfoList crossing column boundaries?

Thread ID:





23814 Jan 20,2005 11:34 AM UTC Jan 20,2005 02:00 PM UTC WinForms 2
Tags: GridControl
Asked On January 20, 2005 11:34 AM UTC

I have a GDBG that I want to allow the user to multi select rows within a column and then perform a right mouse click action on all rows selected. I''ve got that all working fine, but my problem is how do I prevent them from selecting cells from multiple columns? Each column in the grid allows a different right mouse click action so having cells selected from multiple columns would be confusing. What I would like to do is if the user has crossed column boundaries, clear the previous range. I''m having a hard time finding an event to use to capture this situation. Also note they could be selecting via a drag or shift/ctrl-click. Any idea what event(s) to use?

Administrator [Syncfusion]
Replied On January 20, 2005 12:26 PM UTC

Try handling the SelectionChanging event and cancelling it if e.Range is more that 1 column wide.
private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
	if((e.Range.IsCols || e.Range.IsCells) 
		&& e.Range.Left != e.Range.Right)
		e.Cancel = true;

Replied On January 20, 2005 02:00 PM UTC

Works beautifully if you are dragging, but does not handle the ctrl-click. This is a great start though, I should be able to figure out the rest from here. Thanks for the prompt reply!!!


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