I am trying to validate the data entered in a new row and prevent the good data entered being deleted apon a data error being thrown.
I have spent quick a few hours researching this with no luck.
I thought this code would select the bad data cell but the entire row is deleted.
Code:Private Sub PaymentsDataGridView_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles PaymentsDataGridView.DataError MsgBox("Data Error In Row " & e.RowIndex.ToString & ", Column " & e.ColumnIndex.ToString) PaymentsDataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).Selected = True End Sub




Reply With Quote