How to hide popup button in SplitButton?

Posted 7 years ago by Avatar Marcin Nowacki
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 7 years ago by Actipro Software Support - Cleveland, OH, USA
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 7 years ago by Eli Gazit
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 7 years ago by Actipro Software Support - Cleveland, OH, USA
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
Information The latest build of this product (2017.2 build 0665) was released 15 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.