Please don't double-post. When nobody answers to your first post nobody will answer to the second one either. On the other hand when users do respond answers will be scatter between the two threads and the information may become useless to users seeing this discussion later.
I responded to the other thread (
https://forum.lazarus.freepascal.org/index.php/topic,52971.msg391408.html#msg391408). To answer again in different words: Forget to use the DBGrid in the same way as you use the StringGrid. The dataset displayed in the grid determines what is seen and what can be done. For example you cannot navigate within the grid without navigating within the dataset, or to put it the other way round: You must navigate within the dataset if you want to change the active row.
When you absolutely need to know which record is displayed at the top of the grid you must query the internal buffer used by the grid which may be quite difficult because the buffer is not readily available. Or you must navigate the dataset back by the number of rows between the current and top row. You must take case not to confuse the user since this operation will normally scroll the grid. It would probably be easier to abandon the DBGrid and to switch to a StringGrid into which you read all the DB records (which can be come complicated when you have a huge DB accessed via network).