Category / Section
How to get the top or bottom and left or right viewable row and column indexes in WinForms GridControl?
1 min read
Row and column index
To get the Top/Left/Bottom/Right viewable Row and Column index of the grid, use the following code.
C#
// Top Row Index. this.gridControl1.TopRowIndex.ToString(); // Left Column Index. this.gridControl1.LeftColIndex.ToString(); //Bottom Row Index. this.gridControl1.ViewLayout.LastVisibleRow.ToString(); //Right Column Index. this.gridControl1.ViewLayout.LastVisibleCol.ToString();
VB
'Top Row Index. Me.gridControl1.TopRowIndex.ToString() 'Left Column Index. Me.gridControl1.LeftColIndex.ToString() 'Bottom Row Index. Me.gridControl1.ViewLayout.LastVisibleRow.ToString() 'Right Column Index. Me.gridControl1.ViewLayout.LastVisibleCol.ToString()
Figure 1: Visible Row and Column indexes of the GridControl
Samples: