If you run your code in the debugger with it set to stop on exception, you will see where the exception is being generated.
You setting e.Cancel in the validating event because the causes the currentcell.ConfirmChanges call to fail in the currentcell.EndEdit code. The grid throws an exception at this point to tell the caller of EndEdit that the process did not complete. Since you are calling EndEdit at this point, you would have to handle this exception. Here is the relevant code from our library. It is the ConfirmChanges if block that triggers the exception.
public void EndEdit()
{
if (IsLocked || cellRenderer == null)
return;
if (isEditing)
{
if (IsDroppedDown)
CloseDropDown(PopupCloseType.Done);
if (IsModified)
{
if (!this.ConfirmChanges())
{
if (this.Exception != null)
throw this.Exception;
else
throw new Exception(ErrorMessage);
}
}
cellRenderer.RaiseEndEdit();
isEditing = false;
cellRenderer.RaiseEditingComplete();
Grid.RaiseCurrentCellEditingComplete();
}
}