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,
Have you tried this with the latest service release of Infragistics 12.1. I’ve checked the source code of UltraTabbedMdiManger and I did not found anything suspicious in OnMdiChildTextChanged and DirtyTabItem methods, the only possible issue that might occur there with NullRefferenceExeption is if the form for that MdiTab was disposed during the changing of the text. If you are able to isolate this in a simple sample, I’ll be glad to investigate this further for you.
I am waiting for your feedback.
Hi,
thanks for getting back to me.
Yes, this is with 2135, which appears to be the latest SR. In addition, I have a branch with Infragistics 14.1 (SR 2035), and have been able to reproduce it there as well. The stacktrace is the same:
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.EventHandler.Invoke(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) at System.Windows.Forms.Form.set_Text(String value) at [ code of ours that sets the Text property on an MDI child Form ]
I've checked and neither the MdiTab, nor MdiTabGroup, nor Manager have Disposed set to true. Nor is either the child or parent Form disposed.
Oddly, this occurs even with the Manager's Enabled property set to false, i.e. non-tabbed MDI. I've also been able to track down that it doesn't matter what I set the property to; the issue occurs even with simply setting Me.Text (Me being the Form) to Guid.NewGuid().ToString() each time.
However, I have yet to figure out how to isolate this to a simpler sample.
Regards
there we go — I have a simple sample now.
Launch the attached Windows Forms app in a debugger. Click the "Reopen" button, then "Set Title". This will throw the aforementioned exception.
To work around it, simply comment out these lines in FormUtils.cs:
if (tab != null)
tab.MoveToGroup(group);
The Reopen() method's idea is to close a form, then open another form with similar content. We need this in our LOB application to "restart a workflow", if you will.
The main portion of Reopen() is in the middle part, calling .Close() and then .Show(). However, as a convenience, it first finds the existing MdiTab, then its group; then, once the new MdiTab has been opened, it moves that to the same MdiTabGroup the old one was in.
This call to MoveToGroup appears to retain a reference to the old tab, or something like that.
Hope that helps & regards
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 using Infragistics Components.
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?
Please let me know If you need my further assistance on this issue?
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.