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

QuickAccessToolbar - Dropdown

7 Answers 123 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Atle
Top achievements
Rank 1
Atle asked on 15 Apr 2008, 10:24 AM
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

7 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 15 Apr 2008, 05:48 PM
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
0
Subhasis
Top achievements
Rank 1
answered on 14 Mar 2017, 09:58 AM
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.
0
Dimitar
Telerik team
answered on 14 Mar 2017, 10:54 AM
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.
0
Subhasis
Top achievements
Rank 1
answered on 14 Mar 2017, 12:07 PM
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"
0
Dimitar
Telerik team
answered on 15 Mar 2017, 09:31 AM
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.
0
Subhasis
Top achievements
Rank 1
answered on 16 Mar 2017, 05:52 AM

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.

0
Dimitar
Telerik team
answered on 16 Mar 2017, 07:10 AM
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.
Tags
RibbonBar
Asked by
Atle
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Subhasis
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or