VisibleCols Property Example

This example defines buttons to move the grid a whole page left or right.

Private Sub PageRight_Click ()
   'Page grid to the right.
   If DataGrid1.LeftCol + DataGrid1.VisibleCols < _
       DataGrid1.Columns.Count Then
      DataGrid1.LeftCol = DataGrid1.LeftCol + _
       DataGrid1.VisibleCols
   End If
End Sub

Private Sub PageLeft_Click ()
   'Page grid to the left.
   If DataGrid1.LeftCol - DataGrid1.VisibleCols >= 0 Then
      DataGrid1.LeftCol = DataGrid1.LeftCol - _
       DataGrid1.VisibleCols
   End If
End Sub