Only one RowDeselected event firing when unselecting multiple items

Hello,

I am getting some unexpected behavior with row selection/deselection. When selecting multiple items in a dataGrid I get one RowSelected Event per item. I.E if selecting 5 items with click then shift click I get one event for the initial click then 4 consecutive events for the remainder of the selection. 

However when go to deselect these 5 items with escape or selecting another row I am only getting one RowDeselected Event with the data being the last item that was selected in the previous step. 


Is this the intended behavior? How do I get the other items that were dropped from the selection?


Thank you


1 Reply

RS Renjith Singh Rajendran Syncfusion Team June 28, 2022 08:36 AM UTC

Hi Leland,


Greetings from Syncfusion support.


Query : I am only getting one RowDeselected Event with the data being the last item that was selected in the previous step.

This is the default behavior with row deselection in grid. Only single time the RowDeselected event will be triggered in cases of bulk deselection.


So based on your scenario, you can use the GetSelectedRecordsAsync method, to fetch the currently selected records from a particular grid.

https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_GetSelectedRecordsAsync


Please get back to us if you need further assistance.


Regards,

Renjith R


Loader.
Up arrow icon