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

Selection in a Grid

Thread ID:





2729 Feb 11,2003 08:02 PM UTC Feb 12,2003 10:44 PM UTC WinForms 5
Tags: GridControl
Ivan Pelly
Asked On February 11, 2003 08:02 PM UTC

Hi - When I click in the griddataboundgrid, and drag, a range of cells becomes selected, as in Excel. I'd rather have either: 1) just the cell under the mouse (as the dragging occurs) be the selection or 2) the entire row under the mouse comprise the selection (whichever is easier) Any suggestions? Thanks - Ivan Pelly

Administrator [Syncfusion]
Replied On February 12, 2003 10:17 AM UTC

Try setting/unsetting the appropriate flags in the AllowSelection property.

Ivan Pelly
Replied On February 12, 2003 03:29 PM UTC

I am using .AllowSelection = GridSelectionFlags.Row Or GridSelectionFlags.Shift Or GridSelectionFlags.Multiple, which works OK for now. Now how to I tell which rows are selected? Is there a collection of selected rows? Thanks

Administrator [Syncfusion]
Replied On February 12, 2003 04:51 PM UTC

Try this.gridDataBoundGrid1.Selections.GetSelectedRows(true); Stefan

Ivan Pelly
Replied On February 12, 2003 07:03 PM UTC

Thanks. Along the same lines, when I click on a recordselector, the row becomes selected. How would I have the grid de-select that row when the user clicks in a cell that's not in the current row? Thanks again.

Administrator [Syncfusion]
Replied On February 12, 2003 10:44 PM UTC

Handle the CellClick event, then you can call gridDataBoundGrid1.Model.Selections.Clear(); Stefan


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