DataGridView.RowValidated イベント

定義

行の検証が完了した後に発生します。

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

イベントの種類

次のコード サンプルでは、このイベントを使用して、行の検証後に残っている可能性があるエラー注釈をクリアします。

private void RemoveAnnotations(Object sender, 
    DataGridViewCellEventArgs args) 
{
    foreach (DataGridViewCell cell in 
        songsDataGridView.Rows[args.RowIndex].Cells)
    {
        cell.ErrorText = String.Empty;
    }

    foreach (DataGridViewRow row in songsDataGridView.Rows)
    {
        row.ErrorText = String.Empty;
    }
}
Private Sub RemoveAnnotations(ByVal sender As Object, _
    ByVal args As DataGridViewCellEventArgs) _
    Handles songsDataGridView.RowValidated

    For Each cell As DataGridViewCell In _
        songsDataGridView.Rows(args.RowIndex).Cells
        cell.ErrorText = String.Empty
    Next

    For Each row As DataGridViewRow In songsDataGridView.Rows
        row.ErrorText = String.Empty
    Next

End Sub

注釈

このイベントは、 Validated イベントに似ています。 このイベントを使用して、値の行に対して後処理を実行します。

イベントの処理方法の詳細については、「イベントの 処理と発生」を参照してください。

適用対象

こちらもご覧ください