Hi!
I use UltraNumericEditor in a lot of forms in my application. I used version 10.3.20103.1000 for long time since recently where I talked with you for another problem and I had to install latest service release (version 10.3.20103.2094). Since this time I have a very strange bug that happens. The UltraNumericEditor crash when I closed a form with it inside. Here is the stack trace :
at Infragistics.Win.UltraWinEditors.UltraNumericEditorBase.ResetEditorSpinButtonDisplayStyle() in e:\Work\1\190\Sources\RELEASE\WinForms\2010.3\Source\UltraWinEditors\UltraNumericEditorBase.cs:line 2370 at Infragistics.Win.UltraWinEditors.UltraNumericEditorUIElement.PositionChildElements() in e:\Work\1\190\Sources\RELEASE\WinForms\2010.3\Source\UltraWinEditors\UltraNumericEditor.UltraNumericEditorUIElement.cs:line 48 at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.Misc.UltraWinValidator.ValidatorUtilities.GetEditorControlEmbeddableElement(Control control) at Infragistics.Win.Misc.ValidationManager.HookEvents(Control control, Boolean register) at Infragistics.Win.Misc.ValidationManager.RemoveControl(Control control) at Infragistics.Win.Misc.ValidationManager.OnControlDisposed(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.ComponentModel.Component.Dispose(Boolean disposing) at System.Windows.Forms.Control.Dispose(Boolean disposing) at Infragistics.Win.UltraControlBase.Dispose(Boolean disposing) at Infragistics.Win.UltraWinEditors.UltraNumericEditorBase.Dispose(Boolean disposing) in e:\Work\1\190\Sources\RELEASE\WinForms\2010.3\Source\UltraWinEditors\UltraNumericEditorBase.cs:line 1102 at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Control.Dispose(Boolean disposing) at Infragistics.Win.UltraControlBase.Dispose(Boolean disposing) at Infragistics.Win.Misc.UltraGroupBox.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Control.Dispose(Boolean disposing) at System.Windows.Forms.Form.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.Form.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam) at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam) at System.Windows.Forms.Form.Close() at ERP.Core.BaseObjects.ControlsGeneriques.RelationManager.RemoveDefinition(IObjetRelation objRel) in C:\Benoit.Sauve\Projets\ERP.Core\BaseObjects\ControlsGeneriques\RelationManager.cs:line 477
To help you, I can say that I don't use the SpinEditorButton, so the SpinButtonDisplayStyle is set to NEVER. I tried to build a sample and I am not able to reproduce the problem outside my application.
This is a urgent bug because I cannot update my Infragistics dll while this problem exists.
Thanks
Benoit
Sorry, I forgot to say that it is a NullReferenceException that happens here.
Hi Benoit,
I tried this out and I could not get the exception to occur when simply closing the form. But I was able to see the exception if I just call the Dispose method on the UltraNumericEditor while it has an UltraValidator hooked up to it, which appears to be the case in your sample, judging by the call stack.
The UltraValidator is asking the UltraNumericEditor for some information while it is in the process of being disposed and the NumericEditor is trying to do things that it should not be doing while it is in the process of disposing.
I am going to forward this thread over to Infragistics Developer Support so they can look into this and get it fixed.
The funny thing is, if I dispose the UltraValidator component before the UltraNumericEditor, the problem goes away. And by default, a form will dispose it's component (like UltraValidator) before disposing it's controls (like UltraNumericEditor).
So I can only assume that you have modified the default Dispose implementation of your form such that the controls are getting disposed first.
If that's the case, then you should be able to work around this exception by simply disposing the components first.
Hello Francis,
I have logged this as a development issue.
Hi Mike!
Thanks for the answer. I look at my code and I don't think I dispose the controls before the components like the UltraValidator. Anyway, I will look to work around this exception and I will also wait for a fix.
Thanks for your help.