GetTableRowRange Method
Index of first visible row.
Index of last visible row.
Total number of rows in the table.
Gets the indexes of the first and last visible rows, and the table row count.
Remarks
If the index of the first visible row cannot be determined, set pFirstVisible to -1.

If the index of the last visible row cannot be determined, set both pLastVisible and pFirstVisible to -1.

Row indexes are 0-based.

Syntax
'Declaration
 
Protected MustOverride Sub GetTableRowRange( _
   ByRef pFirstVisible As System.Integer, _
   ByRef pLastVisible As System.Integer, _
   ByRef pTotal As System.Integer _
) 
protected abstract void GetTableRowRange( 
   out System.int pFirstVisible,
   out System.int pLastVisible,
   out System.int pTotal
)

Parameters

pFirstVisible
Index of first visible row.
pLastVisible
Index of last visible row.
pTotal
Total number of rows in the table.
Example
protected override void GetTableRowRange
    (out int FirstVisible, 
     out int LastVisible, 
     out int Total) { 
   DataGridView GridView = (DataGridView)(this.SourceControl);
   DataGridViewRowCollection Rows = GridView.Rows; FirstVisible = -1;
   LastVisible = Rows.Count -1; 
   for (int i = 0; i < Rows.Count; i++) { 
       if (Rows[i].Visible == false) continue; 
       FirstVisible = i; 
       break; 
   } 
   for (int i = FirstVisible + 1; i < Rows.Count; i++) { 
       if (Rows[i].Visible) continue; 
       LastVisible = i; 
       break; 
   } 
   FirstVisible++; 
   LastVisible++; 
   Total = GridView.Rows.Count; 
}