You should get a DataPresenter. This dependency object supports the IScrollInfo interface. This interface provides the VerticalOffset and ViewportHeight properties. In fact, the VerticalOffset property is a VisibleIndex for the first row, but the ViewprotHeight is a number of visible rows. Use the GridControl.GetRowHandleByVisibleIndex method to get the first visible and last visible row handles. If the last row handle is not valid, it means that you try to parse empty space, and the last row handle on the screen is the last row within row handles.
Edited:
Starting with v12.1, TableView has the TopRowIndex property, which allows retrieving the index of the first row shown in GridControl.
Question Comments
Added By: James Wilson 10 at: 1/27/2015 1:07:12 AM
This seems clever, but what happens if sort the rows in the grid? Im not sure that this will still work.
Added By: Andrey Kunitsyn (DevExpress Support) at: 1/27/2015 3:32:52 AM
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T201479: Does example E3138 work properly if GridControl is sorted. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Thanks,
Andrey