Displaying custom validation message

I am using the event TableControlCurrentCellErrorMessage on a grid GroupingControl to display Message Boxes with custom error messages.That works fine for most validations like invalid value for DateTime or Int16 etc.But for null value errors or range violations a message box appears with text -
"Save Record : null values not allowed in " .The code I am working on takes the name of the table at runtime . Therefore i do not know the name of the colmn during compile time .
How can i display the same message box but with custom error message.
As mentioned in one of your other threads
i tried using the event TableControlCurrentCellValidating but that disables ur default validations if i build my custome validation in it.
The objective is to use the already built in validations (null and range violations)but with a different message text. How do i achieve this?

1 Reply

HA haneefm Syncfusion Team June 21, 2007 05:45 PM UTC

Hi Anchit,

If you wan to catch the exception then, you need to handle the Table.ExceptionRaised event and set e.Cancel to true. Here is a code snippet

ggc.Table.ExceptionRaised += new Syncfusion.Grouping.ExceptionRaisedEventHandler(Table_ExceptionRaised);
void Table_ExceptionRaised(object sender, Syncfusion.Grouping.ExceptionRaisedEventArgs e)
{
e.Cancel = true;
}

Below is a forum thread that shows this task.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=55049

Best regards,
Haneef

Loader.
Up arrow icon