abraXus
  • abraXus
  • Advanced Member Topic Starter
2021-06-13T14:00:25Z
I am setting the current row using code on an iGrid while the grid is filtered. The row I set it not visible with the filter applied, so I clear the filter, but the selected row remains far below in the grid. I am looking for how to set the TopIndex, or as microsoft would call it: FirstDisplayedScrollingRowIndex - something that will scroll down for me until it is at least visible so the user can see the selected row when I use code to change it.

I'm sure this is possible, but I cannot seem to find it in the documentation. Could you please point me in the right direction?
Igor/10Tec
2021-06-14T15:01:37Z
Option #1:
Use the EnsureVisible() method of the row object (iGRow) you want to show in the viewport.

Option #2:
You can use the iGrid.VScrollBar.Value property to scroll the grid to the exact position you need. Most likely, this position should equal the Y-coordinate of the top edge of the row, which is returned by the iGRow.Y property.
abraXus
  • abraXus
  • Advanced Member Topic Starter
2021-06-14T23:03:50Z
EnsureVisible() does exactly what I wanted. Thanks.

My only suggestion would be to add something to the manual that would help find that suggestion if someone searches for something like TopIndex, but that is up to you.