Hi Francois,
Thank you for your interest in Syncfusion products.
To disable the default error message, you need to set the e.Inner.Cancel as true in TableControlCurrentCellErrorMessage event.
void gridGroupingControl1_TableControlCurrentCellErrorMessage(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellErrorMessageEventArgs e)
{
e.Inner.Cancel = true;
}
To show the error message when you are doing your own validation, you need to handle TableControlCurrentCellValidating event. Please refer the below code for more details.
void gridGroupingControl1_TableControlCurrentCellValidating(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.ColIndex == 2)
{
try
{
int val = Convert.ToInt32(cc.Renderer.ControlText);
}
catch
{
MessageBox.Show("Invalid Number");
}
}
}
Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F73775/main.htmPlease let me know if this helps.
Best Regards,
Srirajan