I'm using v16.2.20162.2045 and getting an OverflowException when using the XamSpreadsheet and a locale. In this particular example, I am setting cells to a Double value with decimals like 3.1415926535. The Workbook.Culture behind the scenes is set to Persian (Iran).
When the spreadsheet is displayed, the numbers are shown in their native characters. When a cell is double clicked, it goes into edit mode and shows what looks like a fraction in English numerals (1/2343135423). When the cell loses focus, the exception occurs.
Any ideas?
System.OverflowException occurred HResult=-2146233066 Message=Value was either too large or too small for an Int32. Source=mscorlib StackTrace: at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at Infragistics.Controls.Grids.Core.SpreadsheetEditHelper.TryParseFraction(String text, Boolean mustHaveLeadingDecimal, IFormatProvider formatProvider, Double& value, Int32& preferredFormatIndex, Boolean& hasLargePostIntegerSpace) at Infragistics.Controls.Grids.Core.SpreadsheetEditHelper.GetNewValue(ISpreadsheetEditInfo info, ISpreadsheetEditorValue value, Boolean createArrayFormula, Boolean useTextForInvalidFormulas, Int32& preferredFormatIndex) at Infragistics.Controls.Grids.Core.SpreadsheetEditHelper.UpdateCells(SpreadsheetCellExitModeAction exitAction, ISpreadsheetEditorValue editValue, Boolean canStayInEditMode, String unformattedText, Boolean wasVisitedHyperlinkCell) at Infragistics.Controls.Grids.Core.SpreadsheetCellEditManager.ExitEditMode(SpreadsheetCellExitModeAction action, Boolean mustExitEditMode, Boolean focusControl) at Infragistics.Controls.Grids.Core.SpreadsheetCellEditManager.EndEdit(SpreadsheetCellExitModeAction action, Boolean force, Boolean returnFalseOnValidationFailure, Boolean focusControl) at Infragistics.Controls.Grids.Core.Spreadsheet.TryExitEditMode(Boolean acceptChanges) at Infragistics.Controls.Grids.Core.SpreadsheetInteractionManager`1.OnMouseDown(InputProxy proxy) at Infragistics.Controls.Grids.Primitives.SpreadsheetElementLayerContainer`1.OnMouseDown(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.ShowDialog()
Hi Walter,
I have tried to set the Culture of the workbook to Persian(Iran) along with the CurrentThread's culture, but I am not able to reproduce the described behavior. Can you please modify the attached sample and describe the steps how to reproduce the issue ?
Looking forward to hearing from you.
Sincerely,Teodor TenevSoftware Developer
By trying edit the first cell in this spreadsheet, it will cause the error.