ErrorProvider - Exception and gridcontrol

Hi,

I have read many forum posts about handling errors (with an errorprovider) in the grid. Now I want to achieve the same behavior as in the gridgrouping control.

I want to show an error icon in the cell that caused the error with a red background (like a frame) and white cell text.

Can you provide a small example on how to handle this?

Cheers,
Chris

4 Replies

HA haneefm Syncfusion Team June 26, 2007 02:20 PM UTC

Hi Chris,

See the below forum threads that shows you "How to customize the error-icon in a cell?".
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=46953
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=55049

Best regards,
Haneef


CH Chris June 26, 2007 06:19 PM UTC

Hi Haneef,

thanks for your two forum threads but both threads describe the handling for a GGC and not a "normal" gridcontrol. I want to achieve the same behavior for the "normal" gridcontrol.

When I take this thread for example (that you mentioned):

http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=55049

private void SetErrorText(object sender, string ErrorMsg)
{
GridGroupingControl grid = sender as GridGroupingControl;
foreach (CurrentRecordProperty prop in grid.Table.CurrentRecordManager.Properties)
{
if (prop.IsError)
prop.Exception = new Exception(ErrorMsg, prop.Exception.InnerException);
}
}

I have no "CurrentRecordManager" in my gridcontrol. So a small example would be great.

Cheers,
Chris


HA haneefm Syncfusion Team June 26, 2007 07:29 PM UTC

Hi Chris,

Here is a minimal sample that shows you "How to set the ErrorIcon in a GridControl?".
ErrorIconInGridControl.zip

Best regards,
Haneef


CH Chris June 26, 2007 08:05 PM UTC

Hi Haneef,

thank you for your sample. So when you enter a value and then click in another cell, the error icon is painted. But when you move to another cell with the cursor keys, no error icon is painted but you can't move to the other cell (because of the error). So how can I paint the error icon even in this mode (while moving to another cell with the cursor keys)?

Furthermore I recognized that when you click in another cell after the error is fixed the other cell shortly shows the error icon too?

Cheers,
Chris

Loader.
Up arrow icon