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

GGC, multiselect rows with mouse only

Hi,
Which event should I use to detect when the user has multi selected rows in a GGC without using the keyboard? E.g. the user clicks a row and drags down which selects 2 or more rows, and then releases the left mouse button.

Thanks
John

3 Replies

AD Administrator Syncfusion Team January 15, 2007 11:15 AM UTC

Are you using the record selection support specific to GridGroupingControl? (ie,

this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;

)

If so, you can use the SelectedRecordsChanging and SelectedRecordsChanged events.


JH John H January 15, 2007 01:06 PM UTC

Thanks Clay,
Another question for you though, why does SelectedRecordsChanged event get called multiple times? Even selecting a single row calls the event 5 times, 4 times with e.Table.SelectedRecords containing 0 records, and once with an add for the selected record.
When selecting multiple rows an add event is triggered for each row, I just want to know the rows that are selected and act upon it. How do I do this?

Thanks
John


AD Administrator Syncfusion Team January 15, 2007 02:12 PM UTC

The RecordChanged event is called when the collection is modified. To see what is going on, you check the e.Action member of the event args. Normally, when you click on a row and start to drag, you see the event hit twice, once with e.Action = Reset and once with e.Action = Add. Then as you select more rows with your drag, you see more events with e.Action = Add.

I do not know of a simple way just to get all the selections at once. To do this this, I think you will have to replace the default selection mouse controller with your own. This will take some coding.

Loader.
Live Chat Icon For mobile
Up arrow icon