We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Catch row validation error message

We have a grid datasource with several columns with AllowDBNull equal to false.

When creating a new record or updating the current one, grid throws an error message automatically

"SaveRecord: Column 'column name' does not Allow nulls."

We would like to customize this message. Please suggest us how to catch this.

We have also tried overriding "gridGroupingControl1_TableControlCurrentCellErrorMessage", but no help.

Appreciate response,

Thanks,
Ram


1 Reply

AS Asarudheen S Syncfusion Team October 10, 2011 05:59 AM UTC

Hi Ram,

Thank you for your interest in Syncfusion products products.

Please make us of “TableControlCurrentCellValidateString” event to achieve the behavior. You can able set the error message here if the current cell validation fails.


void gridGroupingControl1_TableControlCurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellValidateStringEventArgs e)
{
if (e.Inner.Text ==string.Empty)
{
MessageBox.Show("CellValue cannot be empty");
e.Inner.Cancel = true;
}
}


Please let us know if I misunderstood your query.

Regards,
Asarudheen.




Loader.
Live Chat Icon For mobile
Up arrow icon