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.
Unfortunately, activation email could not send to your email. Please try again.

How do I detect GridRangeInfoList crossing column boundaries?

Thread ID:

Created:

Updated:

Platform:

Replies:

23814 Jan 20,2005 06:34 AM Jan 20,2005 09:00 AM Windows Forms 2
loading
Tags: GridControl
Rick
Asked On January 20, 2005 06:34 AM

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 07:26 AM

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;
	}
}

Rick
Replied On January 20, 2005 09:00 AM

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!!!

CONFIRMATION

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.

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.

;