I have a grid control with single selection mode:
gridControl1.ListBoxSelectionMode = SelectionMode.One;
I want to use my custom validation, so I added handler to CurrentCellValidating event
It validates fine, prevents me from moving to another sell from keyboard, but mouse click moves selection to another row:(.
Test code is simple like this:
private void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e)
e.Cancel = gridControl1.CurrentCell.Renderer.ControlText.Length > 3;
ADAdministrator Syncfusion Team October 6, 2003 03:13 PM
The validation only affects moving the current cell but not selecting cells. That's why you see this odd effect in that special case.
Add the following event handler to ensure that you cannot move the selection when the current cell is invalid:
void OnSelectionChanging(object sender, GridSelectionChangingEventArgs e)
e.Cancel = true;