Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1425
Unhandled Exception in FormulaBuilderDialog
posted

Hi all,

I've experienced an issue when adding a function in the FormulaBuilderDialog (example is for the cosine function), via this dialog:

If the user types the '{' or '}' character for an argument (no matter what function it is, with or without quotes), an unhandled exception occurs when the user clicks OK, as follows:

I haven't tested many other possible special characters, but this is the first time I've seen this happen.

If the user clicks Continue now, it's fine, but the function hasn't been added to the Formula Builder (as expected).

The stack trace is:

System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
   at System.Text.StringBuilder.AppendFormat(String format, Object[] args)
   at Infragistics.Win.UltraWinCalcManager.FormulaBuilder.FunctionBuilderDialog.get_Function()
   at Infragistics.Win.UltraWinCalcManager.FormulaBuilder.FormulaBuilderDialog.InsertFunction(UltraCalcFunction function)
   at Infragistics.Win.UltraWinCalcManager.FormulaBuilder.FormulaBuilderDialog.functionsTree_DoubleClick(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
   at Infragistics.Win.UltraControlBase.OnDoubleClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The strange thing about this, is that if the user avoids using the UI for entering the Function parameters, and instead simply types, e.g. cos( "{" ), no unhandled exception occurs and the cells that use this formula show the error value as should be expected.

We haven't made any modifications to the FormulaBuilderDialog, and the stack trace indicates it's not occuring in our code, so we can't catch the exception, of course...

Is this a bug?

Cheers,

Richard