How to get visible row index of filtererd row?

I have two grids, where 2’nd is refreshed on row change of 1’st grid.

The problem I have is when user will enter anything in filter of grid one and then click refresh. Data is reloaded, filters are applied but selected is row which is not visible/filtered out and therefore 2’nd grid is displaying wrong data.

How can I get first visible row index of filtered grid?