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

Selecting rows via cells

Thread ID:





19774 Oct 4,2004 12:30 PM UTC Oct 4,2004 03:56 PM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On October 4, 2004 12:30 PM UTC

I have a grid derived from GridControl. Under certain circumstance, I want selection of a cell to actually select the entire row and sometimes multiple rows. How would I handle this? If I handle the SelectionChanging event can I then modify the range that''s passed in? What is the proper way to set the selection to one or more entire rows?

Administrator [Syncfusion]
Replied On October 4, 2004 12:51 PM UTC

>> If I handle the SelectionChanging event can I then modify the range that''''s passed in? Yes, you can modify e.Range. But make sure you test it for not being empty. This event is raised when selections are cleared with e.Range = empty.

Administrator [Syncfusion]
Replied On October 4, 2004 03:03 PM UTC

I''m getting some unusual behavior. When I select a cell, the SelectionChanging event gets called with the Empty but not with the cell selection. Row selection (which is also enabled) works fine. The SelectionChanging gets called with empty to remove the previous selection and then it gets called again with the new selection. AllowSelection is set to Row | Cell Pete

Administrator [Syncfusion]
Replied On October 4, 2004 03:56 PM UTC

By selecting a cell, do you mean making it the current cell? If so, the default behavior is to not include the currentcell as part of the selections. (Being the currentcell and being selected are not treated as the same thing.) If you set ExcelLikeCurrentCell, then the current cell will be treated as part of the selections. You may also want to turn on ExcelLikeSelectionFrame in this case also. If you do not want this look, then you could try handling CurrentCellMoved, and if the current cell is not part of the selections, then explicilty add it to the selections.


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