This is a migrated thread and some comments may be shown as answers.

Adding items to QuickAccessToolBar overflow menu

2 Answers 77 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Trang
Top achievements
Rank 1
Trang asked on 18 Apr 2012, 07:16 AM
I am using C# and Telerik controls version 2012.1.326

In the Quick Access Toolbar overflow menu, I would like to create additional menu items.  I am referring to items like "Show Below the Ribbon" and "Minimize the Ribbon".  Any ideas on how to add additional menu items?

Thanks,
Trang
 

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 18 Apr 2012, 01:08 PM
Hello Trang,

At the moment the RibbonView control doesn't expose a property/feature allowing to extend the QAT Menu out-of-the-box. However we have logged this issue as a feature request in our PITS where you can vote for it thus increasing its priority.

In the meantime you can add new menu items in code-behind. When the RadRibbonView has loaded and its QuickAccessToolbar is initialized, you can find the RadContextMenu in the overflow button and add new items in it.
private void RadRibbonView_Loaded(object sender, RoutedEventArgs e)
{
    RadRibbonView ribbon = sender as RadRibbonView;
    QuickAccessToolBar qat = ribbon.QuickAccessToolBar;
    RadRibbonDropDownButton dropDownButton = qat.FindChildByType<RadRibbonDropDownButton>();
    if (dropDownButton != null)
    {
        StackPanel dropDownContent = dropDownButton.DropDownContent as StackPanel;
 
        RadContextMenu menu = dropDownContent.Children[1] as RadContextMenu;
        if (menu != null)
        {
            menu.Items.Add(new RadMenuItem { Header = "My New MenuItem 1" });
            menu.Items.Add(new RadMenuItem { Header = "My New MenuItem 2" });
            menu.Items.Add(new RadMenuItem { Header = "My New MenuItem 3" });
        }
    }
}

I attached a sample project demonstrating this approach. Please give it a try and let me know if it helps.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Trang
Top achievements
Rank 1
answered on 25 Apr 2012, 04:22 AM
Thank you for the quick response.  It allowed me to accomplish what I needed to do.

Thanks,
Trang
Tags
RibbonView and RibbonWindow
Asked by
Trang
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Trang
Top achievements
Rank 1
Share this question
or