QuickAccessToolbar - Dropdown

2 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. UI for WinForms is Visual Studio 2017 Ready
Back to Top