FirstVisibleColumn Property

DataGrid.FirstVisibleColumn Property


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.

Legacy Code Example

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
© 2015 Microsoft