DataGridView.CellStateChanged Event

 

Occurs when a cell state changes, such as when the cell loses or gains focus.

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

Public Event CellStateChanged As DataGridViewCellStateChangedEventHandler

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

The following code example illustrates the use of this event.

Private Sub dataGridView1_CellStateChanged(ByVal sender As Object, _
    ByVal e As DataGridViewCellStateChangedEventArgs) _
    Handles dataGridView1.CellStateChanged

    Dim state As DataGridViewElementStates = e.StateChanged
    Dim msg As String = String.Format( _
        "Row {0}, Column {1}, {2}", _
        e.Cell.RowIndex, e.Cell.ColumnIndex, e.StateChanged)
    MessageBox.Show(msg, "Cell State Changed")

End Sub

.NET Framework
Available since 2.0
Return to top
Show: