QuickAccessToolbar - Dropdown

8 posts, 0 answers
  1. Atle
    Atle avatar
    13 posts
    Member since:
    Dec 2007

    Posted 15 Apr 2008 Link to this post

    Hi,

    Next to the QuickAccessToolbar items there is a dropdown with "Show Below the Ribbon" and "Minimize the Ribbon" options. How do I get access to these elements so I can change the text. Wants to support multiple language in my application.

    Regards,
    Atle
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 15 Apr 2008 Link to this post

    Hi Atle,

    Thank you for writing.

    You could change the text of QuickAccessDropDown, but you should consider that it is dynamically generated when it is displayed for the first time. Moreover, the first part of the items depends of the buttons, which are added in QuickAccessToolbar so you should be careful about adding buttons at run-time.

    Please review the code-block below:

    private void Form1_Load(object sender, EventArgs e)  
    {  
        RadToolStripOverFlowButtonElement quickAccessButton = ((RadToolStripOverFlowButtonElement)this.radRibbonBar1.RootElement.Children[0].Children[0].Children[0].Children[1].Children[1]);  
        quickAccessButton.DropDownOpened += new EventHandler(quickAccessButton_DropDownOpened);  
    }  
     
    void quickAccessButton_DropDownOpened(object sender, EventArgs e)  
    {  
        RenameQuickAccessDropDownItems();  
    }  
     
    private void RenameQuickAccessDropDownItems()  
    {  
        RadDropDownMenu quickAccessMenu =  
            ((RadToolStripOverFlowButtonElement)this.radRibbonBar1.RootElement.Children[0].Children[0].Children[0].Children[1].Children[1]).DropDownMenu;  
     
        for (int i = 0; i < quickAccessMenu.Items.Count; i++)  
        {  
            if (!(quickAccessMenu.Items[i] is RadMenuSeparatorItem))  
            {  
                quickAccessMenu.Items[i].Text =   
                    quickAccessMenu.Items[i].Text + String.Format(" (item{0})", i);  
            }  
        }  

    I hope this helps. Do not hesitate to contact me again if you need additional assistance.

    Regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Subhasis
    Subhasis avatar
    5 posts
    Member since:
    Mar 2017

    Posted 14 Mar Link to this post

    Hi,
    Can you please tell how can I add custom menu items in the dropdown of Quick AcCess Toolbar.  The default items are "show bellow the ribbon" and "minimize the ribbon". I want to add one or two custom menus here through code.
  4. Dimitar
    Admin
    Dimitar avatar
    1650 posts

    Posted 14 Mar Link to this post

    Hi Subhasis,

    The following article shows how you can add items programmatically: Customizing the Quick Access Menu.

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Subhasis
    Subhasis avatar
    5 posts
    Member since:
    Mar 2017

    Posted 14 Mar in reply to Dimitar Link to this post

    I guess this will add items in quick access toolbar. What I need is to add Items in the dropdown next to the quick access toolbar whose by default elements are  "show bellow the ribbon" and "minimize the ribbon"
  6. Dimitar
    Admin
    Dimitar avatar
    1650 posts

    Posted 15 Mar Link to this post

    Hi Subhasis,

    The items are created dynamically so to add items just in the drop down you need to use the DropDownOpened event. For example:
    public RadForm1()
    {
        InitializeComponent();
        radRibbonBar1.RibbonBarElement.QuickAccessToolBar.OverflowButtonElement.DropDownOpened += OverflowButtonElement_DropDownOpened;
    }
     
    private void OverflowButtonElement_DropDownOpened(object sender, EventArgs e)
    {
        var button = sender as RadQuickAccessOverflowButton;
        button.Items.Add(new RadMenuItem("CustomItem"));
    }

    Do not hesitate to contact us if you have other questions.
     
    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Subhasis
    Subhasis avatar
    5 posts
    Member since:
    Mar 2017

    Posted 16 Mar in reply to Dimitar Link to this post

    Hi Dimitar,

    Thank you for your help. I am facing a unique problem in this case. I am developing in C# WPF. I am using QuickAccessToolBar.RadRibbonDropDownButton item as I could not find QuickAccessToolBar.OverflowButtonElement and it is fine. If I use a simple RadRibbonView class for my Ribbon control and use DropDownOpened event as you suggested there is no problem. Everytime I click on the RadRibbonDropDownButton icon, the event is triggered and everything is perfect.

    But the problem arises as I am using a class CustomRibbonView : RadRibbonView [CustomRibbonView is derived from RadRibbonView]. I HAVE NOT written any specific code for Quick Aceess Toolbar in this class [Am I missing a trick here?]. Now in the MainWindow.xaml.cs file in RibbonBar.Load event I have suscribed to DropDownOpened event. Please refer below:-

     

    Now when the application is loaded for first time and I click on the RadRibbonDropDownButton icon in QAToolBar, ther suscribed event is fired and everything is fine. If I click on the first item i.e. "Show Below The Ribbon" and the toolbar goes below the ribbon as expected. But now if I click on the RadRibbonDropDownButton icon again, the event DropDownOpened is not fired and it is not fired anytime after. 

    Could not figure it out.

  8. Dimitar
    Admin
    Dimitar avatar
    1650 posts

    Posted 16 Mar Link to this post

    Hi Subhasis,

    Please note that this is the WinForms forum. Please ask you questions about the WPF suite in the appropriate forum: UI for WPF Forums - Telerik Community.

    Thank you for your understanding.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top