I do not have a good suggestion for handling this problem. Our Calculate library actually has a property that tells the engine to rethrow parsing error so you can catch them if you want. But I am not sure even whether adding that property to the GridFormulaEngine would allow you to catch this particular error or not. We will have to research this to see what might be possible.
You can actually catch this behavior in SaveCellInfo if you want. The idea is that anytime a formulacell is saved whith an error, you catch it. Here is a snippet that worked for me in that sample you mentioned. Due to the errors being raised, this event is actually hit more than once, so you may have ot add code to make sure you only do something one time.
private bool CheckIfError(string s)
{
foreach(string s1 in this.engine.FormulaErrorStrings)
{
if(s1 == s)
return true;
}
return false;
}
private void gridCashFlow_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
if(e.Style.CellType == "FormulaCell"
&& e.Style.Text.Length > 1
&& e.Style.Text[0] == ''=''
&& CheckIfError(e.Style.FormattedText))
{
MessageBox.Show(string.Format("error {0},{1} {2}", e.RowIndex, e.ColIndex, e.Style.FormattedText));
}
}