0

I have a CheckComboBox from the wpfToolkit and i want to reset it. That means that all items in the CheckComboBox are unchecked. Already tried to set the SelectedValue to an empty string. This works for the function itself, but in the UI the items are still checked.

I also work with Bindings and the MVVM pattern:

 <wpfTool:CheckComboBox IsSelectAllActive="True"  ItemsSource="{Binding Filter, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding SelectedFilterItem, UpdateSourceTrigger=PropertyChanged}" Width="140"/>
                   
Donkanaille
  • 29
  • 1
  • 4

2 Answers2

0

The following should work for the SelectedValue property:

SelectedValue="{x:Bind SelectedFilterItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

Then you should be able to reset it to null by changing your SelectedFilterItem property.

  • 1
    Thank you for your comment, but i think x:Bind is not available in WPF according to this: https://stackoverflow.com/questions/60153403/wpf-c-sharp-net-framework-4-8-xbind – Donkanaille Jun 25 '21 at 09:17
0

I found a solution that worked for me. Its important to set SelectedValue and SelectedItem to null. Also set Mode=TwoWay and UpdateSourceTrigger=PropertyChanged to be sure.

Donkanaille
  • 29
  • 1
  • 4