DataGridView.RowValidated Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs after a row has finished validating.
public:
event System::Windows::Forms::DataGridViewCellEventHandler ^ 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
Event Type
Examples
The following code sample uses this event to clear up any error annotations that may have been left behind after validating the row.
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
Remarks
This event is analogous to the Validated event. Use this event to perform post-processing on a row of values.
For more information about how to handle events, see Handling and Raising Events.
Applies to
See also
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.