Adding items to QuickAccessToolBar overflow menu

3 posts, 0 answers
  1. Trang
    Trang avatar
    11 posts
    Member since:
    Feb 2012

    Posted 18 Apr 2012 Link to this post

    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. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Apr 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Trang
    Trang avatar
    11 posts
    Member since:
    Feb 2012

    Posted 24 Apr 2012 Link to this post

    Thank you for the quick response.  It allowed me to accomplish what I needed to do.

    Thanks,
    Trang
Back to Top