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.

Cell value can not be validated automatically

Thread ID:

Created:

Updated:

Platform:

Replies:

54254 Jan 4,2007 09:30 AM Jan 5,2007 06:48 AM Windows Forms 4
loading
Tags: GridControl
kun
Asked On January 4, 2007 09:30 AM

Hi there,

I have a Gridcontrol contains several columns, which has different value types.

The problem is, when I insert a wrong type of value into a cell, for example a string into a integer type cell, instead of poping up a window tells me the foramt is wrong, the program catches FormatException.

I dont know if there is any way to set the Gridcontrol to be able to automatically validate the value and shows the pop up window

Thanks in anticipation

Kun

Babu Chella Velu [Syncfusion]
Replied On January 4, 2007 10:27 PM

Hi Kun,

You can handle the CurrentCellErrorMessage event of grid, which you can display your own custom message box whenever the grids CurrentCell.DisplayWarningText (as a result of some kind of validation error) is called.

Please refer the attached sample for the implementation.

InvalidDatatype.zip

private void gridDataBoundGrid1_CurrentCellErrorMessage(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellErrorMessageEventArgs e)
{
MessageBox.Show(e.Text,"NewError",MessageBoxButtons.OKCancel );
e.Cancel = true;
}

Best Regards,
Babu

Administrator [Syncfusion]
Replied On January 5, 2007 04:20 AM

Hi Babu,

thank you for your reply.

But I am using Gridcontrol. It does not have the CurrentCell.CurrentCellErrorMessage event. I am using Syncfusion 3.0.0.19.

Kun

>Hi Kun,

You can handle the CurrentCellErrorMessage event of grid, which you can display your own custom message box whenever the grids CurrentCell.DisplayWarningText (as a result of some kind of validation error) is called.

Please refer the attached sample for the implementation.

InvalidDatatype.zip

private void gridDataBoundGrid1_CurrentCellErrorMessage(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellErrorMessageEventArgs e)
{
MessageBox.Show(e.Text,"NewError",MessageBoxButtons.OKCancel );
e.Cancel = true;
}

Best Regards,
Babu

Administrator [Syncfusion]
Replied On January 5, 2007 05:53 AM

Hi Kun,

Sorry for the incovenience caused.

In Essential Studio 3.x, There is no event named CurrentCellErrorMessage. It has newly added in Essential Studio V4.2. But you can customize the error messagebox in a cell by handling the CurrentCellValidating or CurrentCellValidate or CurrentCellValidateString event in a grid. Please refer to the below KB article for more details.

What are the different validation events and event members? When are they triggered and how are they used?

Thanks for your patience.

Best Regards,
Haneef

kun
Replied On January 5, 2007 06:48 AM

Thank you, that helped

>Hi Kun,

Sorry for the incovenience caused.

In Essential Studio 3.x, There is no event named CurrentCellErrorMessage. It has newly added in Essential Studio V4.2. But you can customize the error messagebox in a cell by handling the CurrentCellValidating or CurrentCellValidate or CurrentCellValidateString event in a grid. Please refer to the below KB article for more details.

What are the different validation events and event members? When are they triggered and how are they used?

Thanks for your patience.

Best Regards,
Haneef

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.

;