Row deselection with pagination

Hi,

I have a datagrid that is single row selectable with pagination. My issue is the selected row gets deselected when the page is changed.  Is there a way to prevent/modify this behavior?

Thanks


3 Replies

RS Renjith Singh Rajendran Syncfusion Team May 4, 2022 05:39 AM UTC

Hi Dylan,


Greetings from Syncfusion support.


We suggest you to enable the PersistSelection property of GridSelectionSettings to persist selection in grid. Please refer the codes below,


 

  <GridSelectionSettings PersistSelection="true"></GridSelectionSettings>

 


Please refer the notes section of below link for more details on PersistSelection,

Refer notes section in this documentation : https://blazor.syncfusion.com/documentation/datagrid/selection#checkbox-selection

Online Demo : https://blazor.syncfusion.com/demos/datagrid/checkbox-selection?theme=bootstrap4


Please get back to us if you need further assistance.


Regards,

Renjith R



DS Dylan Smith May 4, 2022 09:46 AM UTC

Hi Renjith,

Thank you for your reply.

I have implemented the checkbox mode with persistent selection. However, this makes it possible to select more than one record, even when my selection type is set to Single. To be clear, I would like the ability to select only a single record and have it persist. 


Thank you



RS Renjith Singh Rajendran Syncfusion Team May 5, 2022 09:56 AM UTC

Hi Dylan,


By default, if you have a checkbox column then grid selection will behave as multiple selection. This is the default behavior of Checkbox Selection.


If you want to reset the previously selected row on clicking the row, then we suggest you to set the CheckboxMode as ResetOnRowClick as true in GridSelectionSettings. But now, if you select the rows by using checkbox, then it will act as the Multiple Selection only. Kindly refer the below documentation for your reference.


https://blazor.syncfusion.com/documentation/datagrid/selection/#checkbox-selection

https://blazor.syncfusion.com/documentation/datagrid/selection/#checkbox-selection-mode


Please get back to us if you need further assistance.


Regards,

Renjith R


Loader.
Up arrow icon