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.

How to reset the default value when validate data

Thread ID:

Created:

Updated:

Platform:

Replies:

28814 May 11,2005 03:38 AM May 11,2005 11:28 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 11, 2005 03:38 AM

Hi, In DataBoundGrid, I use ValidateFailed to validate a numeric column as below: private void dgrSelectedFields_ValidateFailed(object sender, Syncfusion.Windows.Forms.Grid.GridValidateFailedEventArgs e) { GridCurrentCell cc = this.dgrSelectedFields.CurrentCell; int row = cc.RowIndex; int col = cc.ColIndex; string strValue = dgrSelectedFields[row, col].Text; string strMessage = "Item ''" + strValue + "'' does not pass validation test."; cc.ErrorMessage = ""; MessageBox.Show(strMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); e.Handled = false; } Could you please tell me how to reset the default value of the cell after the MessageBox shown? Because the default value will only be reset when user press ESC key. Thanks

Administrator [Syncfusion]
Replied On May 11, 2005 04:37 PM

Try setting dgrSelectedFields[row, col].Text = defaultValue; dgrSelectedFields.RefreshRange(GridRangeInfo.Cell(row, col), true);

Administrator [Syncfusion]
Replied On May 11, 2005 11:28 PM

Thanks for your reply. >Try setting > >dgrSelectedFields[row, col].Text = defaultValue; >dgrSelectedFields.RefreshRange(GridRangeInfo.Cell(row, col), true); >

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.

;