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

Detect error in formula

Thread ID:

Created:

Updated:

Platform:

Replies:

100006 Jun 26,2011 11:25 AM UTC Jun 27,2011 01:01 PM UTC WPF 1
loading
Tags: GridControl
Mehrdad
Asked On June 26, 2011 11:25 AM UTC

hi,
how can I detect a formula entered by user has error in GridControl?
for example it's typed if(C1-- it doesn't have ) --



Manikandan [Syncfusion]
Replied On June 27, 2011 01:01 PM UTC

Hi Mehrdad,

Thanks for using Syncfusion Products.

By default we validate the formula expressions internally. We don't have any method to perform the validation explicitly. However You can achieve your requirement by handling CurrentCellEditingComplete event as follows:

Code Snippet [C#]

this.grid.CurrentCellEditingComplete += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(grid_CurrentCellEditingComplete);

void grid_CurrentCellEditingComplete(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
{
int row = this.grid.CurrentCell.RowIndex;
int col = this.grid.CurrentCell.ColumnIndex;

if (this.grid.Model[row, col].Text == this.grid.Model[row, col].FormattedText)
{
MessageBox.Show("Error Message");
}
}

We have prepare a sample based on this, please find the sample from the following location.

Sample: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Sample_Grid1269947087.zip

Please let us know if this helps.

Regards,
Manikandan



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

;