I have the following code. What I am trying to do is after a cell value has changed from one of these 3 columns, I want to validate data. If it comes back false I want to go back to the cell that just failed validation. I have the following code and the validation works, however I cant seem to get it to go back to the unvalidated cell.
thanks in advance
Here is the code
Private Sub dgv1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv1.CellValueChanged
Dim myError As String = ""
If isLoading Then
If e.ColumnIndex = 5 Then
ElseIf e.ColumnIndex = 6 Then
If ValidateColumn(dgv1(e.ColumnIndex, e.RowIndex).Value.ToString, e.ColumnIndex, myError) Then
dgv1.CurrentCell = dgv1.Rows(e.RowIndex).Cells(e.ColumnIndex)
'dgv1.Rows(e.RowIndex).Cells(e.ColumnIndex).Selected = True
ElseIf e.ColumnIndex = 8 Then