Question

ribbon:ComboBox leave popup open

Posted 8 months ago by Avatar Ralph Gucwa - Racelogic

I noticed StaysOpenOnClick property which prevents the parent popup from closing.  Unfortunately it doesn't seem to affect the drop down part of ribbon:ComboBox.

I'm trying to implement a multiselect ComboBox and I want its drop down part to stay open while the user clicks the checkboxes and only close it when the user clicks outside the ComboBox.  Any suggestions how to implement it?


Comments (4)

Posted 8 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

So that I can better understand what you are doing, are you making a completely custom control that inherits from ComboBox and you have that in a popup, such as for a PopupButton?  And you want clicks on the ComboBox's popup to not close the popup that contains the ComboBox itself?

[Modified 8 months ago]


Actipro Software Support
Posted 8 months ago by Ralph Gucwa - Racelogic

My plan is to inherit from ribbon ComboBox and change its behaviour so that instead of just item names the drop down section displays a list of checkboxes and the main textbox part displays a comma separated list of selected items.   It will be bound to a flags enum property in the viewmodel.  The drop down part of the ComboBox should stay open while the user clicks the checkboxes and it should close when either Escape is pressed or the user clicks anywhere outside the ComboBox. The main problem for me is forcing the drop down part to stay open.  Is it something you can control within the ribbon ComboBox, or is it a problem completely unrelated to Actipro controls?

Posted 8 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Ralph,

At least from using Reflector and looking at ComboBoxItem, Microsoft has an OnMouseLeftButtonUp override that ends up calling a method in ComboBox that will close the popup.  You might need to create a class that inherits ComboBoxItem and overrides that method to not call the base logic.  Then you'd have to override ComboBox.GetContainerForItemOverride to return an instance of your new class instead.


Actipro Software Support
Posted 8 months ago by Ralph Gucwa - Racelogic

Thanks for that, it worked indeed.

Unfortunately further down my implementation I hit numerous problems and I finally gave up the idea of inheriting from ComboBox, it had too many internal and private members which were critical to its behaviour.

I ended up inheriting from ListBox instead.  I based my control on the following project:

https://www.codeproject.com/Articles/45782/A-WPF-Combo-Box-with-Multiple-Selection

Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.