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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

validate string in ggc

Thread ID:





70804 Jan 2,2008 12:50 PM UTC Jan 2,2008 11:59 PM UTC WinForms 1
Tags: GridControl
Asked On January 2, 2008 12:50 PM UTC

I am using syncfusion ggc 5.2. I want that if user enters a string which is more than 1000 characters the cell should show a error with an error message(error message only when user points to error symbol of cell).
I will be v thankfull if anyone could help me in this.

haneefm [Syncfusion]
Replied On January 2, 2008 11:59 PM UTC

Hi Prabhjeet,

To validate the grid cell string, you need to handle the TableControlCurrentCellValidateString and set the e.Inner.Cancel to true for invalid text. Below are the codes:

void gridGroupingControl1_TableControlCurrentCellValidateString(object sender, GridTableControlCurrentCellValidateStringEventArgs e)
if( e.TableControl.CurrentCell.Renderer.ControlText.Length > 10 )
e.Inner.Cancel = true;
FieldDescriptor fd = e.TableControl.Table.CurrentRecordManager.CurrentField;
CurrentRecordProperty prop = e.TableControl.Table.CurrentRecordManager.Properties[ fd ];
prop.Exception = new Exception( "Invalid Text"); //Error Message in a Cell;
MessageBox.Show("Invalid Text"); //Poup Error Message


Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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