Hi, Im'using an UltraTabControl in a DashboardControl, having a page for every Tab, and a TableLayoutPanel in each page, that has some events hooked (DropDown etc). There is a AddTab method that adds a page to the dashboard:
public UltraTab AddTab(String pTabKey, int pColumns, int pRows, Boolean pAddPage){
UltraTab tp = tabControl.Tabs.Add(pTabKey, pTabKey);
// tabControl is the UltraTabControl
....
// adds a TableLayoutPanel
TableLayoutPanel tlp = new TableLayoutPanel();
// hooks some events
HookTableLayoutPanelEvents(tlp);
tp.TabPage.Controls.Add(tlp); tabControl.SelectedTab = tp;
}
My App opens a Dashboard manager UI where it loads a saved dashboard. The first time it opens it works fine, but if user closes the tab of the Dashboard manager, and opens it again (each time a new instance of the manager is loaded) and opens the dashboard it throws the NullReferenceException on the codeline:
but tabControl is not null, nether pTabKey... the stacktrace says the exception is thrown somewhere in the Infragistics.Win.UltraWinTabControl.UltraTabControlBase.OnManagerSelectedTabItemChanged(Object sender, SelectedTabItemChangedEventArgs e) method.
Do I miss something? Is possible that some event Handler is still hooked when I close the Manager (and dispose the Dashcboard control) so the next time it opens somethig goes wrong? By srching in my code I can't figure out where is the problem.
Any clues?
Thanks Alessandro
I forgot... I'm using NetAdvantage 2010.2
Chears... Alessandro