With UltraWinTabbedMdi 12.1.20121.2135, I'm getting a hard-to-reproduce NullReferenceException when changing an MDI tab's title by setting Form.Text. The stack trace starts off like this:
at Infragistics.Win.UltraWinTabbedMdi.MdiTabGroup.DirtyTabItem(MdiTab tab, Boolean invalidate, Boolean textChanged, Boolean imageChanged) at Infragistics.Win.UltraWinTabbedMdi.MdiTab.OnMdiChildTextChanged(Object sender, EventArgs e) at System.Windows.Forms.Control.OnTextChanged(EventArgs e) at System.Windows.Forms.Form.OnTextChanged(EventArgs e) at System.Windows.Forms.Control.set_Text(String value)
I'm guessing that I may be disposing something prematurely, since I've made changes to that regard recently. However, I haven't been able to track it down. In addition, neither MdiTab.OnMdiChildTextChanged nor MdiTabGroup.DirtyTabItem seem to appear in the documentation.
The new value for Form.Text is not null, and the tab is supposed to be visible.
Hello,
Please let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.
Hello ,
Could you please explain me why implementation of Reset Form() method is not an option for you, I've implemented such method in your sample and it works so good. So you could just copy and paste my ResetForm() method in your solution and to test it.
I am waiting for your feedback.
Hi Hristo,
for architectural reasons, reinitializing the existing form isn't currently a feasible option. You're right, of course, that this would be a lot cleaner.
Is there an easy way to retain the MdiTabGroup's settings (e.g. "split horizontally; on the right side"), then recreate a tab group with those settings if there is no more tab in the group?
I am just checking about the progress of this issue. Let me know If you need my further assistance on this matter ?
Thank you for the provided sample. I’ve investigate it and it seems that you are getting this NullRefference exception only if there only one MDIChild Form. What exactly happen there:
When you click Reopen button, your current form is closed, which dispose your form, this affect the corresponding UltraTab which also must be disposed, and if there were only one tab in corresponding TabGroup (like in your case), this tab group is excluded from ToolbarManager collections and it is ready for dispose. And since you have instants to it, GC doesn’t collect it (if you set breakpoint on line 32 for your FormUtils class and check the TabManager you will see that it is null). When you change the Text of your form, corresponding Tab is subscribed for the text change event of Form and it trays to change its caption, which affects corresponding TabGroup (this tabGroup tha has null for TabbedMadiManager) which cause this NullRefference expiation. This explain also why if you comment
if (tab != null)
tab.MoveToGroup(group);
this works. If you comment this lines you do not reposition your tab to a TabGroup which doesn’t have MDITabbedMamanger. I believe that you are doing this in order to reload your form in the same TabGroup, so what you could do in your case is instead to close and recreate your form just to create a method which will reload what you need (or might call InitializeComponent() method and then to call LoadEvent of your form). Another options is to check if the corresponding TabGroup has only one tab, if so you shouldn’t call MoveToGroup() method for this group.
Please let me know if you have any further questions.