Search code examples
delphisetrowselecteddbgrid

Select row after refreshing DBGrid


Well, some kind of n00b question from me. I've surfed the net and similar questions here but haven't found any right answers for such simple (as I thought) problem.

I have a DBGrid. I select one row and make some actions with another data linked to this row. After I finished, my DBGrid being refreshed and selected row resets to first. I want to get the same row selected that was selected before refreshing DBGrid data. Any suggestions?


Solution

  • Before refreshing, save the linked dataset's current selection as a bookmark, then restore the bookmark afterwards.