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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC Validation handling

Thread ID:

Created:

Updated:

Platform:

Replies:

73775 May 19,2008 08:12 AM UTC May 26,2008 08:42 AM UTC WinForms 3
loading
Tags: GridControl
Francois Buhagiar
Asked On May 19, 2008 08:12 AM UTC

Hi

I would need to show an error provider in a cell , i noticed that the GGC already dose that when for example you enter letters in a numeric field.
My question is how can i show that icon and highlight the cell red when i do my own validation ?
How can i stop it from showing a message box?
Why is the message box showing three times?

Thanks for the any help
Regards
Francois


Sri Rajan [Syncfusion]
Replied On May 23, 2008 01:06 AM UTC

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.htm

Please let me know if this helps.

Best Regards,
Srirajan


Francois Buhagiar
Replied On May 23, 2008 06:40 AM UTC

Hi

I would actuality need to show the error in an error provider which is in the cell, so that the i don't need to use a message box.

Is that possible?

Regards


SubhaSheela R [Syncfusion]
Replied On May 26, 2008 08:42 AM UTC

Hi Francois,

Sorry for the inconvenience caused.

You can supress error message from popup. Here is the minimal sample that shows the desired behavior for your reference:

GGCErrorProviderNoErrorMessage.zip

Please let me know if it helps.

Regards,
Subhasheela R



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;