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

Selection in a Grid

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

5 Replies

AD Administrator Syncfusion Team February 12, 2003 05:17 AM

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


IP Ivan Pelly February 12, 2003 10:29 AM

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


AD Administrator Syncfusion Team February 12, 2003 11:51 AM

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


IP Ivan Pelly February 12, 2003 02:03 PM

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.


AD Administrator Syncfusion Team February 12, 2003 05:44 PM

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

Loader.
Live Chat Icon For mobile
Up arrow icon