How to hide popup button in SplitButton?

Ribbon for WPF Forum

Posted 14 years ago by Marcin Nowacki
Version: 10.2.0531
Avatar
Hi
In some special situation I need to hide popup button in SplitButton (Ribbon control). I found property IsPopupButtonEnabled but is read only. Is there any way to achieve this?

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marcin,

While you can't hide the drop-down button portion without re-templating the control, I believe you can set a SplitButton.PopupCommand and handle its CanExecute to determine whether that portion is enabled. It's what drives IsPopupButtonEnabled.


Actipro Software Support

Posted 13 years ago by Eli Gazit
Avatar
I have a problem using this solution. when i try to disable the popup, the entire split button is also gets disabled. i use two different commands - one for the button and one for the popup. when the popup command binding 'canExecute' returns false, the entire button is disabled though the 'canExecute' of the button command returns true.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eli,

Yes that is true. Looking at the code, it appears to be by design because one of the Ribbon spec requirements is:
"Both the menu and button portion of Split Button controls MUST be disabled on the Ribbon if all of the items in the menu are inactive."

So unfortunately there isn't a way to keep the button active but the popup disabled since that would violate the ribbon requirement.


Actipro Software Support

The latest build of this product (v24.1.3) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.