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.
Syncfusion Feedback

Data Validation

Thread ID:

Created:

Updated:

Platform:

Replies:

725 Aug 6,2002 10:15 AM UTC Aug 6,2002 01:20 PM UTC WinForms 1
loading
Tags: GridControl
Teodorico Morell
Asked On August 6, 2002 10:15 AM UTC

I would like to implement my own validation routines for the grid. I have tried events like CurrentCellValidating and CurrentCellChanging. These events have the arguments “System.ComponentModel.CancelEventArgs e” and “Syncfusion.Windows.Forms.Grid.GridCellsChangingEventArgs e”. Setting “e.Cancel = true” does abort the editing, but how can I get the value entered by the user . All the properties that I have tried return the data that is already present in the grid, not the data being entered by the user. This data is needed to perform the validation. Teo

Clay Burch [Syncfusion]
Replied On August 6, 2002 01:20 PM UTC

You can get at this value through the CurrentCell.Renderer.
private void gridControl1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e)
{
	string newValue = this.gridControl1.CurrentCell.Renderer.ControlText;
	string oldValue = this.gridControl1[this.gridControl1.CurrentCell.RowIndex, this.gridControl1.CurrentCell.ColIndex].Text;
	Console.WriteLine(newValue + "   " + oldValue);
}

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

;