Editable grid sorting issue

I have an editable grid where data is prepopulated. I m using pagination to show 15 rows per page. I m using the sort in the pagination to sort based on one field. If I select any rows from first page and then navigates to second page and select one row. After navigating to first page sorting gets disabled. And the values I selected are showing sequentially from the top. How can I prevent the sort to be stable

  Discussion posts and replies are publicly visible