I have an issue when using the UltraTabControl in Visual Studio 2008. When the form is closed an exception is thrown in the Dispose method of the form. The stack trace is below and you can see that it stems from the Dispose of the UltraTab control. The error message is: "Object of type 'System.EventHandler' cannot be converted to type 'Infragistics.Win.UltraWinTabControl.ActiveTabChangedEventHandler"
This happens every time I run my project then stop debugging. After this happens, any changes I make in the designer _are not saved_ in the form.designer.cs file! If I run the project my changes do not exist. If I close the form designer then reopen, all my changes are lost!
Any ideas?? Thanks.
Drew
System.ArgumentException occurred Message="Object of type 'System.EventHandler' cannot be converted to type 'Infragistics.Win.UltraWinTabControl.ActiveTabChangedEventHandler'." Source="mscorlib" StackTrace: at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) at System.Reflection.MethodBase.CheckArguments(Object[ parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[ parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[ parameters, CultureInfo culture) at System.ComponentModel.ReflectEventDescriptor.RemoveEventHandler(Object component, Delegate value) at System.ComponentModel.ReflectPropertyDescriptor.RemoveValueChanged(Object component, EventHandler handler) at System.Windows.Forms.Binding.BindTarget(Boolean bind) at System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent value) at System.Windows.Forms.ControlBindingsCollection.ClearCore() at System.Windows.Forms.ControlBindingsCollection.Clear() at Infragistics.Win.UltraControlBase.Dispose(Boolean disposing) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.Dispose(Boolean disposing) at Infragistics.Win.UltraWinTabControl.UltraTabControl.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Control.Dispose(Boolean disposing) at Infragistics.Win.IGPanel.Dispose(Boolean disposing) at Infragistics.Win.UltraWinTabControl.UltraTabPageControl.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Control.Dispose(Boolean disposing) at Infragistics.Win.UltraControlBase.Dispose(Boolean disposing) at Infragistics.Win.UltraWinTabControl.UltraTabControlBase.Dispose(Boolean disposing) at Infragistics.Win.UltraWinTabControl.UltraTabControl.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.Windows.Forms.Control.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 OftsDesk.TransactionEntry.Dispose(Boolean disposing) in C:\proj\OFTS\OftsDesk\trunk\OftsDesk\TransactionEntry.Designer.cs:line 31 InnerException:
It sounds like your using the simple binding infrastructure of .Net. If so, you should not be binding to the ActiveTab property as that property is not bindable. When you use simple binding, the Binding class looks for an event with a name like PropertyNameChanged and it assumes it to be of type eventhandler but the ActiveTab property is not marked as bindable and the event ActiveTabChanged is not of that delegate type.
Thanks for your quick reply! That did take care of the exception being thrown however I still have issues with changes in the designer not being persisted to form.designer.cs. This seems to me that the two problems are unrelated. Also, I was able to reproduce this issue in other forms. My environment is Vista Business 32bit, VS.NET 2008, C# 3.0, NA 7.3 with Office 2007 look and feel enabled and UltraToolbarManager on all of the forms so I can have the RoundedCorners and 2007 look through the app. I will try to reproduce in a much simpler sample.
Any ideas?
Thanks again for your prompt reply.
The problem with the changes not being saved has been reported and fixed. It occurs when an UltraToolbarsManager is on a Form and that Form's designer is open while the application is run. Any changes made to the designer after that are ignored. You can contact the support group and reference issue BR29198 to be notified when the hotfix becomes available: http://es.infragistics.com/gethelp.
Thanks! Your prompt reply is much appreciated.