CurrentCell data type validation

Hi -
Is there a way to tell that validation has failed due to a data type error?
We are handling CurrentCellValidating but would like to display our own error message when the problem is due to the user inputting a wrong data type.
Thanks,
Julie

2 Replies

AD Administrator Syncfusion Team March 5, 2007 10:06 PM UTC

Hi Julie,

You can handle the CurrentCellErrorMessage event of grid, which you can display your own custom message box whenever the grids CurrentCell.DisplayWarningText (as a result of some kind of validation error) is called.

Please refer the attached sample for the implementation.
InvalidDatatype.zip

private void gridDataBoundGrid1_CurrentCellErrorMessage(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellErrorMessageEventArgs e)
{
MessageBox.Show(e.Text,"NewError",MessageBoxButtons.OKCancel );
e.Cancel = true;
}

Best regards,
Haneef


JL Julie Levy March 5, 2007 10:18 PM UTC

Thanks Haneef.

Loader.
Up arrow icon