Hi,
I have a validation in place for a cell in ultrawingrid that user can not leave that cell as blank. The problem is - the grid shows the validation message after the user leaves that cell as blank but the focus goes to another cell where user clicks. is there any way I can retain the focus on the cell in question?
I am showing the validation message in BeforeCellUpdate event. Following is my code -
If TypeOf e.NewValue Is System.DBNull Then
Dim message As String = "The value for the cell can not be left blank"
e.Cancel = True
'ugCanopySpecies.Focus()
e.Cell.Activate()
ugCanopySpecies.PerformAction(UltraGridAction.EnterEditMode)
'e.Cell.SelectAll()
Return
End If
and changing the value of rowupdatecancelaction does not make any difference.
thanks,
Mandeep.
If you want to prevent the user from leaving the cell, you should cancel the BeforeExitEditMode event instead of BeforeCellUpdate.
-Matt