Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
How to remove "Add to Quick Access" option?
posted

Hi,

      I have added a Ribbon Tab "Home". Inside that i have a group named "File" which has 2 button options namely "Open" and "Save". When i right-click on the "File" group, i am having the option "Add to Quick Access Toolbar". I want this option to be enable only when we right-click on the a Tool instead of group. This can be achieved once we set the option "Office2007UICompatibility" to false and in the event "BeforeToolbarListDropdown" we can remove it. Can we achieve the above scenario by not setting the "Office2007UICompatibility" to false? Can we do it using code. Is there a way to do it?

Thanks

Rajagopalan.

Parents
  • 53790
    Suggested Answer
    posted

    Hi,

    You got the right way to enabled/ disable the context menu. Maybe you need to add only this piece of code:


    public Form1()
    {
        InitializeComponent();
        ultraToolbarsManager1.Office2007UICompatibility = true;
        ultraToolbarsManager1.BeforeToolbarListDropdown += new Infragistics.Win.UltraWinToolbars.BeforeToolbarListDropdownEventHandler(ultraToolbarsManager1_BeforeToolbarListDropdown);
    }
     
    void ultraToolbarsManager1_BeforeToolbarListDropdown(object sender, Infragistics.Win.UltraWinToolbars.BeforeToolbarListDropdownEventArgs e)
    {
        if (e.Tool != null &&  e.Tool.OwnerIsRibbonGroup)
        {
            Debug.WriteLine("Context menu is enabled ...");
        }
        else
        {
            e.Cancel = true;
            Debug.WriteLine("Context menu is disabled …");
        }
    }

    Please if you have any questions, do not hesitate to ask me

Reply Children
No Data