Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » QuickAccess Toolbar Collapse All
Subject Author Date
Mark Matthews Sep 24, 2007 - 11:17 AM

Is there a way to prevent a user from adding a button to the quick access toolbar - or, preferably, to hide the dropdown arrow next to it? In my application, some of the buttons only make sense to use on the tab page they are on, so I don’t want the user to be able place them in the quick access toolbar and press them when that tab page is not in view. I would like to be able to add buttons at design time only.

Thanks

Technical Support Sep 26, 2007 - 7:10 AM

Please use the following code

    class MyRibbon : Ribbon
    {
        /// <summary>
        /// Determines whether the control can be placed into the Quick Access Toolbar. It can be overriden in a derived class.
        /// </summary>
        /// <param name="control">Control for which the value is retrieved.</param>
        /// <returns>The value is true if the control can be placed in the Quick Access Toolbar; false otherwise.</returns>
        protected override bool CanControlBePlacedIntoQuickAccessToolbarFilter(IControl control)
        {
            if(/*control cannot be placed into QAT*/)
                return false;

            return base.CanControlBePlacedIntoQuickAccessToolbarFilter(control);
        }
    }

Technical Support Sep 25, 2007 - 11:46 AM

We are sorry but we missed the NOT in the first sentence:

You can achieve this by overriding Ribbon.CanControlBePlacedIntoQuickAccessToolbarFilter(), in which just return false for all the controls that should NOT be added to the quick access toolbar.

Technical Support Sep 25, 2007 - 11:11 AM

You can achieve this by overriding Ribbon.CanControlBePlacedIntoQuickAccessToolbarFilter(), in which just return false for all the controls that should be added to the quick access toolbar. We understand that you have some specific requirements for some UI objects but please note that the idea of fluent UI implies that every control can be placed into QAT regardless of control’s context.

Mark Matthews Sep 25, 2007 - 4:17 PM

Thanks, I see a Ribbon.CanControlBePlacedIntoQuickAccessToolbar, but not a Ribbon.CanControlBePlacedIntoQuickAccessToolbarFilter. I tried overriding Ribbon.CanControlBePlacedIntoQuickAccessToolbar, but I get a "no suitable method found to override" error. I created a class based on the Elegant.Ui.Ribbon class but I can’t get past the compile error. I’m sure it’s something dumb that I’m doing - but not sure what?