DataGridView.RowHeaderMouseClick Event

 
System_CAPS_noteNote

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

Occurs when the user clicks within the boundaries of a row header.

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

Public Event RowHeaderMouseClick As DataGridViewCellMouseEventHandler

For more information about handling events, see NIB: Consuming Events.

The following code example illustrates the use of this event.

Private Sub dataGridView1_ColumnHeaderMouseClick( _
    ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) _
    Handles dataGridView1.ColumnHeaderMouseClick

    Me.dataGridView1.SelectionMode = _
        DataGridViewSelectionMode.ColumnHeaderSelect
    Me.dataGridView1.Columns(e.ColumnIndex).HeaderCell _
        .SortGlyphDirection = SortOrder.None
    Me.dataGridView1.Columns(e.ColumnIndex).Selected = True

End Sub

Private Sub dataGridView1_RowHeaderMouseClick( _
    ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) _
    Handles dataGridView1.RowHeaderMouseClick

    Me.dataGridView1.SelectionMode = _
        DataGridViewSelectionMode.RowHeaderSelect
    Me.dataGridView1.Rows(e.RowIndex).Selected = True

End Sub

.NET Framework
Available since 2.0
Return to top
Show: