How to return the focus to the row of the datagrid (vb6) even though the SQL data rows exceed the max windows rows displayed.
Posted on 2016-11-25
We have a vb6 form that has a datagrid. When the user double-clicks on the desired row, the apps open 2d form to work with. The user finishes with the 2d form and the controls return the first form and to the row prior leaving t he first form (we use 'grdDataGrid.SetFocus').
However, the datagrid windows form has a max of 10 rows to display. To see more rows, the user scrolls down. So if the user opens the 2d form in the 15 row (scrolling past the 10th row) and finished the with 2d form, the controls doesn't return to the actual 15th-scrolled-down-row, rather it returns to the row position equivalent to the 10 row window.
What we are trying to do is that control return to the actual 15th row, scrolling the screen to get to that row.
Please advice on this.
(we are thinking of holding the actual "how many scroll down" the user did and redo the scroll and use the .setfocus to return ot it, but can't seem to get there)