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

GDBG: Error Icon instead of messagebox

Hi

I've been trying to get the sample code from your KB working:
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=321

However, I still get a messagebox displayed e.g. "Column 'Code' does not allow nulls" and don't see an error icon for the row.
I've tried handling the CurrentCellErrorMessage event and setting e.cancel=true however this doesn't fix it.

I'd just like to show an error icon for the row, no messagebox. When the user hovers over the icon they should see the error message.

what am i missing?

2 Replies

HA haneefm Syncfusion Team July 30, 2007 04:02 PM UTC

Hi Richard,

The grid does not throw this exception(not null), and so does not really know what column caused it. It is your datasource that is throwing this exception. If you want to customize this from a grid event, try handling the ValiateFailed event, and in your handler set grid.CurrentCell.ErrorMessage. Below is a code snippet

this.gridDataBoundGrid1.ValidateFailed += new GridValidateFailedEventHandler(gridDataBoundGrid1_ValidateFailed);
void gridDataBoundGrid1_ValidateFailed(object sender, GridValidateFailedEventArgs e)
{
this.gridDataBoundGrid1.CurrentCell.ErrorMessage = string.Empty;
e.Handled = true;
}

Best regards,
Haneef


RB Richard Bysouth August 29, 2007 04:36 AM UTC

thanks Haneef - that works great!

Loader.
Live Chat Icon For mobile
Up arrow icon