1

Starting a new question from this thread, Can anyone answer why a ComboBox with CheckBoxes would behave differently inside and outside of a toolbar?

Summary from linked question:

I noticed that there is a difference of behavior when the ComboBox is placed in a Toolbar. When not in the Toolbar, it behaves as expected: the CheckBox changes state without closing the Popup. But in the ToolBar, the Popup closes on the first click, regardless of where the click is. Try the new code, please. I really need this in a toolbar.

Community
  • 1
  • 1
gregsdennis
  • 7,218
  • 3
  • 38
  • 71

1 Answers1

3

I'd like to thank jberger for suggesting I go to MS.

As suggested by MS, the solution is to set the CheckBox.Focusable property to False in the template.

    <DataTemplate DataType="MyDataClass">
        <CheckBox Focusable="False" ... />
        <TextBlock ... />
    </DataTemplate>

This provides the desired behavior when the ComboBox is either in a ToolBar or just floating in some Panel.

gregsdennis
  • 7,218
  • 3
  • 38
  • 71