DataGrid.FirstVisibleColumn Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the index of the first visible column in a grid.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public int FirstVisibleColumn { get; }

Property Value

Type: System.Int32

The index of a DataGridColumnStyle.

A column is considered visible even if it is partially concealed.

If a particular column is not visible, set the CurrentCell property to the cell that should be visible.

The following code example scrolls the grid if the first visible column is greater than five.

Private Sub ScrollGrid(ByVal myGrid As DataGrid)
    If myGrid.FirstVisibleColumn > 5 Then
       myGrid.CurrentCell = New DataGridCell( 1,1 )
    End If
 End Sub

.NET Framework
Available since 1.1
Return to top