Private Sub UltraGrid1_BeforeExitEditMode( _
ByVal sender As System.Object, _
ByVal e As BeforeExitEditModeEventArgs) _
Handles UltraGrid1.BeforeExitEditMode
If Me.UltraGrid1.ActiveCell Is Nothing Then Return
'Perform this action only on the "Bonus" column:
If Me.UltraGrid1.ActiveCell.Column.Key <> "Bonus" Then Return
'Make sure that a value exists
If Me.UltraGrid1.ActiveCell.Text Is Nothing OrElse _
Me.UltraGrid1.ActiveCell.Text = String.Empty Then Return
Dim currentValue As Integer = _
Integer.Parse(Me.UltraGrid1.ActiveCell.Text)
Dim baseValue As Integer = _
CType(Me.UltraGrid1.ActiveCell.Row.Cells("BaseValue").Value, Integer)
If currentValue < baseValue Then
Me.lblError.Text = "Current Value cannot be less than Base Value"
e.Cancel = True
End If
End Sub