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.
Unfortunately, activation email could not send to your email. Please try again.

GGC Validation handling

Thread ID:

Created:

Updated:

Platform:

Replies:

73775 May 19,2008 04:12 AM May 26,2008 04:42 AM Windows Forms 3
loading
Tags: GridControl
Francois Buhagiar
Asked On May 19, 2008 04:12 AM

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 22, 2008 09:06 PM

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 02:40 AM

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 04:42 AM

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.

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.

;