How to lock selected rows during sorting

I’ve already implemented checkbox for each row in GridView and able to store the selected row indexes. How can I lock the selected rows so they would always be on top of the GridView even if sorting would be applied? Thanks!

You will have to write custom logic to store the selected options probably in your database and retrieve them during your query. You will want to do something like this so you can sort or paginate and still retain proper pagination, not getting duplicate entries, and proper page sizes.

1 Like