How to persist selected rows in DataGrid when paging while using LoadData event

What's your app, Blazor server or WASM? If you are using Blazor server and the data are coming from database you can use directly EF IQueriable as DataGrid Data instead LoadData. When using LoadData persisting selection can be tricky since every time you will get different data items with different hash code.

UPDATE: We've decided to add KeyProperty to the DataGrid component to improve item persistence in such cases. It will be available in our next update Monday:

1 Like