Best way to keep popup button open when it has a checkbox

Ribbon for WPF Forum

Posted 16 years ago by Brad Daszynski
Version: 3.5.0421
I have a popup menu button and I am wanting some of its menu items to be check boxes. However, I can't seem to find a good way to keep the popup button's menu open when I click a check box. What is the best way to accomplish this? My code is something like this (btw, I'm not hard set on having a "checkbox menu item"... as long as there is a checkbox in my popup button's menu that, when checked/unchecked, doesn't cause the popup menu to close):

<ribbon:PopupButton Label="Search" StaysOpenOnClick="True">
<ribbon:ComboBox MinWidth="100" Label="Search:" IsEditable="True">
<ComboBoxItem>Previous search item 1</ComboBoxItem>
<ComboBoxItem>Previous search item 2</ComboBoxItem>
<ComboBoxItem>Previous search item 3</ComboBoxItem>
<ribbon:Separator Label="Search Options" />
<ribbon:CheckBox Label="Option 1" IsChecked="True" />
<ribbon:CheckBox Label="Option 2" IsChecked="False" />

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
You almost have it, just set StaysOpenOnClick="True" on the checkboxes. You probably don't need it on the PopupButton.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.