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
345
How to add a RibbonGroup to the QAT?
posted

Hi,

I am trying to add a RibbonGroup as a whole to the QAT with some C# code.  How do I do this?  I tried:

myRibbonWindow.Ribbon.QuickAccessToolbar.Items.Add(new QatPlaceHolderTool(myribbonGroup.Id));

However, I get a run time error that: Tool being added to the QuickAccessToolbar is not registered!

Am I doing things out of order, or is there a special property on the RibbonGroup I need to set before doing this?

Also, when are you planning on releasing this Beta as an actual product release?

thanks

KZ

Parents
No Data
Reply
  • 8576
    Verified Answer
    Offline posted
    Hi KZ -
     
    The QatPlaceholderTool constructor you are using assumes that the item you are creating the placeholder for is a Tool.  Since you are adding a RibbonGroup in this case, you must use the constructor overload that takes a second parameter of type QatPlaceholderToolType.  So the line of code should look like:
     

        myRibbonWindow.Ribbon.QuickAccessToolbar.Items.Add(new QatPlaceholderTool(myribbonGroup.Id, QatPlaceholderToolType.RibbonGroup));

     
    Hope this helps.
Children