Compartir por


DataGridView.CellValidated Evento

Definición

Se produce después de que la celda haya terminado de validarse.

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 

Tipo de evento

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el CellValidated evento para borrar la ErrorText propiedad . En este ejemplo, el CellValidating evento establece ErrorText si el usuario escribe datos que no son válidos en una celda. Este ejemplo forma parte de un ejemplo más grande disponible en el SelectionChanged evento .

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

Comentarios

Controlar este evento es útil para el procesamiento posterior a la validación del valor de celda.

Para obtener más información sobre cómo controlar eventos, consulte Control y generación de eventos.

Se aplica a

Consulte también