Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
UltraTabControl throws a NullReferenceException
posted

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:

UltraTab tp = tabControl.Tabs.Add(pTabKey, pTabKey);

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

 

 

 

 

 

Parents
No Data
Reply Children
No Data