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

Date Validation Failure

Thread ID:





51638 Nov 9,2006 08:38 PM UTC Nov 23,2006 10:20 PM UTC WinForms 4
Tags: Grouping
Administrator [Syncfusion]
Asked On November 9, 2006 08:38 PM UTC


I'm currently trying to handle date validation within a cell and when validation fails the focus doesn't seem to set back to the cell properly.

If you see in the attached project when an invalid date is entered, for example 6/ , a message box is displayed. I'd like for the cursor to be placed back in the cell and the user to be able to type again. Right now we're forced to click the cell again in order to enable editting.

I have also tried handling the TableControlCurrentCellConfirmChangesFailed event to call BeginEdit(true); on the cell but this does not work.


Administrator [Syncfusion]
Replied On November 10, 2006 12:26 PM UTC

Hi Paulo,

We will work out for a solution and let you know the details soon. Thanks for being patience.

Best regards,

Administrator [Syncfusion]
Replied On November 21, 2006 03:53 PM UTC

Any word on this yet?

Administrator [Syncfusion]
Replied On November 23, 2006 05:37 AM UTC

Hi Paulo,

Our apologies for the delay in response.

You can handle the CurrentCellValidating event and use the MoveTo method to activate the currentcell. Here is a code snippet

private void gridGroupingControl1_TableControlCurrentCellValidating( object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e )
if ( e.TableControl.CurrentCell.Renderer.StyleInfo.CellValueType == typeof( DateTime ) )
object cellVal = e.TableControl.CurrentCell.Renderer.ControlValue;
string cellText = e.TableControl.CurrentCell.Renderer.ControlText;

if ( ( cellVal == null )
&& ( ( cellText != String.Empty )
|| ( cellText != null ) ) )
MessageBox.Show( "error" );
e.Inner.Cancel = true;
int row = e.TableControl.CurrentCell.RowIndex;
int col = e.TableControl.CurrentCell.ColIndex;
e.TableControl.CurrentCell.MoveTo(row, col, GridSetCurrentCellOptions.SetFocus);


Sample : ModifiedWindowsApplication3.zip

Best Regards,

Administrator [Syncfusion]
Replied On November 23, 2006 10:20 PM UTC

This appears to work. Thank you


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