-1

I'm using WPF ComboBox. When popup is opened and user clicks somewhere outside, popup closes. But I would like to leave popup opened and bypass standard behavior of the ComboBox in this case. I found here a solution. It is suitable for bypass the standard behavior of ComboBox, but the popup still closes. If I trying to set in this time ComboBox.IsDropDownOpen=true, my application crashes with error "Cannot reopen a popup in the closed event handler".

Have you any ideas how to solve this problem? Thanks!

SergS
  • 29
  • 6

1 Answers1

0

I don't think that it is possible to set this behaviour to ComboBox. You can try to do that with ListBox though: just set ListBox.Height = 20 and expand it on ListBox.SelectionChanged().

And if for some reason you need ListBox to look exactly like ComboBox - you could use control templates.

  • to @pec orange: Thank for comment. I already thought about it, too. But so far I'm trying with ComboBox – SergS Jan 28 '18 at 09:39
  • to @pec orange: I now tried with ListBox. Unfortunately, this is not the behavior that I need. – SergS Jan 28 '18 at 10:14