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
520
XamNumericEditor Spinner Exception
posted

Hi, 

I have a XamNumericEditor with Spinner on:

<igEditors:XamNumericEditor SpinButtonDisplayMode="Always"
                                    SpinIncrement="1000"
                                    Mask="{double:15.2}"/>

When I have value x<1000 and click out and in the editor, I start seeing a lot of exceptions thrown:value does not match the mask.

A first chance exception of type 'System.ArgumentException' occurred in InfragisticsWPF3.Editors.v10.2.dll

Breaking at exception, the call stack is:

value does not match the mask

     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.InputCharBase.Char.set(char value = '-') + 0xa0 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.NumberSection.SetText(string text = "-79") + 0x1dc bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.XamMaskedEditor.SetDoubleValue(Infragistics.Windows.Editors.SectionsCollection sections = Count = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized., double val = -79.0, Infragistics.Windows.Editors.MaskInfo maskInfo = {Infragistics.Windows.Editors.MaskInfo}) + 0x3ce bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.XamMaskedEditor.SetDataValue(Infragistics.Windows.Editors.SectionsCollection sections = Count = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized., System.Type dataType = {Name = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. FullName = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.}, object val = -79.0, Infragistics.Windows.Editors.MaskInfo maskInfo = {Infragistics.Windows.Editors.MaskInfo}) + 0x477 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.MaskInfo.InternalRefreshValue(object dataValue = -79.0, out System.Exception error = null) + 0x16d bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.XamMaskedEditor.ValidateValue(object value = -79.0, out System.Exception error = null) + 0xc9 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.SpinInfo.IsValueValid(object value = -79.0) + 0x84 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.SpinInfo.SpinHelper(bool up = false, out object newValue = -79.0) + 0xed9 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.SpinInfo.CanSpin(bool up = false) + 0x3f bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.EditInfo.CanSpin(bool up = false, object amount = null) + 0x21d bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.EditInfo.CanSpin(bool up = false) + 0x35 bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.EditInfo.CurrentState.get() + 0x77c bytes   
     InfragisticsWPF3.Editors.v10.2.dll!Infragistics.Windows.Editors.XamMaskedEditor.Infragistics.Windows.Commands.ICommandHost.CanExecute(Infragistics.Windows.Commands.ExecuteCommandInfo commandInfo = {Infragistics.Windows.Commands.ExecuteCommandInfo}) + 0x102 bytes   
     InfragisticsWPF3.v10.2.dll!Infragistics.Windows.Commands.Commands<Infragistics.Windows.Editors.XamMaskedEditor>.IsCommandAllowed(Infragistics.Windows.Commands.ICommandHost commandHost = {Infragistics.Windows.Editors.XamNumericEditor}, System.Windows.Input.RoutedCommand command = {System.Windows.Input.RoutedUICommand}, object commandParameter = null, object originalSource = {Infragistics.Windows.Editors.XamNumericEditor}, out bool continueRouting = false, out bool forceHandled = false) + 0x1bd bytes   
     InfragisticsWPF3.v10.2.dll!Infragistics.Windows.Commands.Commands<Infragistics.Windows.Editors.XamMaskedEditor>.OnQueryCommand(object target = {Infragistics.Windows.Editors.XamNumericEditor}, System.Windows.Input.CanExecuteRoutedEventArgs args = {System.Windows.Input.CanExecuteRoutedEventArgs}) + 0x1c8 bytes   
     PresentationCore.dll!System.Windows.Input.CommandBinding.OnCanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e) Line 147 + 0xd bytes    C#

It seems that XamNumeric is trying to validate if it should disable the spin down button which trigger the validation for (x - 1000) value which is a negative value and as my mask does not allow for negative values, this threw exception. I know that I can turn off exception message but this is very annoying when debugging. Do we have any fix for this? or work around?

Thank you very much.

 

 

 

 

 

 

 

 

Parents
  • 8421
    posted

    Thank you for your patience while I researched this issue. It looks like the best options for this are to either hide all exceptions from the Output window, which you mentioned, or to leave them on, save the output, and then open them in another editor, and then remove them from the file.

    I have also logged a development issue for this so that development team can research this issue further and see if we can avoid the exception from occurring in the code, even though the exception is handled. I've logged this issue as 60190 and will also be creating a private case on your behalf so that I can send you information you can use for tracking this issue.

Reply Children
No Data