DataGridView.CellValidated Událost

Definice

Nastane po dokončení ověřování buňky.

public:
 event System::Windows::Forms::DataGridViewCellEventHandler ^ CellValidated;
public event System.Windows.Forms.DataGridViewCellEventHandler CellValidated;
public event System.Windows.Forms.DataGridViewCellEventHandler? CellValidated;
member this.CellValidated : System.Windows.Forms.DataGridViewCellEventHandler 
Public Custom Event CellValidated As DataGridViewCellEventHandler 

Event Type

Příklady

Následující příklad kódu ukazuje, jak použít CellValidated událost k vymazání ErrorText vlastnosti. V tomto příkladu CellValidating událost nastaví ErrorText , jestli uživatel zadá do buňky neplatná data. Tento příklad je součástí většího příkladu, který je k dispozici v SelectionChanged události.

private void DataGridView1_CellValidated(object sender,
    DataGridViewCellEventArgs e)
{
    // Clear any error messages that may have been set in cell validation.
    DataGridView1.Rows[e.RowIndex].ErrorText = null;
}
Private Sub CellValidated(ByVal sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles DataGridView1.CellValidated

    ' Clear any error messages that may have been set in cell validation.
    DataGridView1.Rows(e.RowIndex).ErrorText = Nothing
End Sub

Poznámky

Zpracování této události je užitečné pro následné ověření zpracování hodnoty buňky.

Další informace o zpracování událostí najdete v tématu Zpracování a vyvolávání událostí.

Platí pro

Viz také