Hi, I need programmatically to activate a tab in a child ribbon in a UltraToolbarsManager control based on Infragistics 2008 Vol 1 using the Key value of the tab to reference my tab to activate.
Thanks in advance.
Luca
If you are just aksing how to select a ribbon tab in a toolbars manager based on the key, you can use code similar to this:
this.ultraToolbarsManager1.Ribbon.SelectedTab = this.ultraToolbarsManager1.Ribbon.Tabs[ "RibbonTabKey" ];
If, on the other hand, you are asking how to select an mdi merged child ribbon tab in the parent manager, then you need to first find the parent tab hosting the child tab, then select that:
UltraToolbarsManager activeChildManager = this.ultraToolbarsManager1.ActiveMdiChildManager;
if ( activeChildManager == null ) return;
RibbonTab childTab = activeChildManager.Ribbon.Tabs[ "RibbonTabKey" ];RibbonTab parentTab = childTab.AttachedParentTab;
if ( parentTab == null ) return;
activeChildManager.Ribbon.SelectedTab = parentTab;
My application is based on:
Form A: mdi form with UltratoolbarsManager with 2 tabs (key = "T1" and key="T2") in the ribbon; ultratoolbarsmanager1.mdimergeable = true
Form B: child form with UltratoolbarsManager with 1 tab (key = "T3") in the ribbon; mdimergeable = true; ultratoolbarsmanager1.mdimergeable = true
Form A open Form B: the two ribbons are merged: the result is one ribbon with 3 tabs: T1, T2, T3; actually the T1 tab is the active tab but i need to make programmatically T3 to be the active tab.
Executing in the main form the code in your reply throw an exception "The specified tab belongs to a different Ribbon." executing the line "activeChildManager.Ribbon.SelectedTab = parentTab;".
What is the problem.
Thanks.
I apologize Luca, the last line of my code was incorrect. Use this line instead (where this.ultraToolbarsManager1 is the manager in the mdi parent):
this.ultraToolbarsManager1.Ribbon.SelectedTab = parentTab;
It works fine.
Thank you very much.