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

How to reset the default value when validate data

Thread ID:

Created:

Updated:

Platform:

Replies:

28814 May 11,2005 07:38 AM UTC May 12,2005 03:28 AM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 11, 2005 07:38 AM UTC

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 08:37 PM UTC

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

Administrator [Syncfusion]
Replied On May 12, 2005 03:28 AM UTC

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.

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

;