How to get Viewable Row, Column Indexes in Windows Forms Grid Control

18 Nov 20181 minute to read

Use the following variables to get the viewable row and column indexes.

//Top Row Index.
this.grid.TopRowIndex

//Left Column Index.
this.grid.LeftColIndex

//Bottom Row Index.
this.grid.ViewLayout.LastVisibleRow

//Right Column Index.
this.grid.ViewLayout.LastVisibleCol
'Top Row Index.
Me.grid.TopRowIndex

'Left Column Index.
Me.grid.LeftColIndex

'Bottom Row Index.
Me.grid.ViewLayout.LastVisibleRow

'Right Column Index.
Me.grid.ViewLayout.LastVisibleCol