Can't remove RibbonContextualTabGroup from parent

May 1, 2009 at 7:49 PM
Edited May 1, 2009 at 7:51 PM

Hello,

I tried to separate a RibbonContextualTabGroup from it's parent, but it's failed. Here is my snippet:

RibbonContextualTabGroup rctg = plugin.Instance.RibbonContextualTabGroup;
if (rctg != null)
{
Ribbon parent = (Ribbon)plugin.Instance.RibbonContextualTabGroup.Parent;
if (parent != null)
{
parent.ContextualTabGroups.Remove(rctg);
}
ribbonMain.ContextualTabGroups.Add(rctg); // <-------- here i get the exection to separate element from parent
}

I'm using the same procedure for the RibbonTab's and here it works! Do you have any suggestions?

Thanks a lot! - Regards Cai