1

I have custom control, derived from combobox.

I want it to not close itself when I select an item. If I set the IsDropDownOpen property to false in protected override void OnDropDownClosed(EventArgs e), this method just starts to chain invoke itself.

If IsDropDownOpen is set in the OnSelectionChanged handler nothing happens.

Any suggestions?

Kev
  • 118,037
  • 53
  • 300
  • 385
  • Maybe you could use a `ListView` rather than a `ComboBox` if you don't want the open/close system? – jv42 Feb 25 '13 at 13:32

2 Answers2

1

See this answer -- https://stackoverflow.com/a/22814332/1547004

Essentially, install an eventFilter on the ComboBox's listview to catch the MouseButtonPress event to prevent it from passing through and causing the listview to close.

Community
  • 1
  • 1
Brendan Abel
  • 35,343
  • 14
  • 88
  • 118
-1

No way. ComboBox is ComboBox, when a item is selected automatically closes it. ListBox is a good option here.

Regards.

Christian Amado
  • 946
  • 1
  • 7
  • 31