Hi,
Im using a datagrid view.
Im validating two columns.
Min mark and Max Mark columns are validated in the way that
Minimum Mark should be greater than Maximum mark.
im displaying error text in the column.
the problem is when i enter the correct value, the error text doesnot goes until the user goes to the next cell.
its not good.
It need to be vanished when i enter the correct value.
im using the following method
Private Sub grdDisplay_CellEnter _
(ByVal sender As Object, _
ByVal e As _
System.Windows.Forms.DataGridViewCellEventArgs) _
Handles grdDisplay.CellEnter
If Val(grdDisplay.CurrentRow.Cells(2).Value) > _
Val(grdDisplay.CurrentRow.Cells(3).Value) Then
grdDisplay.CurrentRow.Cells(3).ErrorText = _
"Minimum Marks should not exceed Maximum Marks"
Exit Sub
Else
grdDisplay.CurrentRow.Cells(2).ErrorText = Nothing
grdDisplay.CurrentRow.Cells(3).ErrorText = Nothing
grdDisplay.CurrentRow.Cells(2).ReadOnly = False
grdDisplay.CurrentRow.Cells(3).ReadOnly = False
End If
End Sub
please suggest me a different method other than
cellEnter