Automatic Validations in Grid Grouping Control

Hi ,

I want to know how to handle unwanted validations that take place in gridgrouping control.
version 4.4.0.55
Example:
If I enter date like 00/00/2007
then grid show messagebox as Date entered is invalid.
I want to handel it by giving my own customized message.
Pls support your answer with sample code.
Thanks in Advance,
Aditi

1 Reply

HA haneefm Syncfusion Team June 5, 2007 03:43 PM UTC

Hi Aditi,

You can handle the TableControlCurrentCellErrorMessage event to display your own custom message box whenever the grids CurrentCell.DisplayWarningText (as a result of some kind of validation error) is called. Here is a code snippet

private void GroupingGrid_TableControlCurrentCellErrorMessage(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellErrorMessageEventArgs e)
{
//To get the orginal error from e.Inner.Text
MessageBox.Show("AddNewUnique Error",MessageBoxButtons.OKCancel,MessageBoxIcon.Error );
e.Inner.Cancel = true;
}

Also refer to 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

Loader.
Up arrow icon