How to use update source trigger for Wpf Combobox, which is editable?

I have a combo box (in my application wpf-mvvm). I set IsEditable = true . But the β€œproperty changed event” gets fired when I start typing.

How can I set UpdateSourceTrigger = Propertychanged here?

Also .. I need to call the check function if the user has entered a new value (I mean, except for those that are available in the list using the editing functions).

Any help would be appreciated.

  <ComboBox ItemsSource="{Binding Path = PlanTypeBasedContractNumberList }" Width="90" IsEditable="True" SelectedValue="{Binding GeneralCharacteristicsDataContext.ContractNumber.Value}"> </ComboBox> 
+4
source share
1 answer

In an editable ComboBox SelectedItem and SelectedValue properties refer to Popup elements, not to an editable element. After you start typing, SelectedItem will become "unselected" and why the event occurs.

To bind a TextBox value to a ComboBox , use the Text property:

 <ComboBox IsEditable="True" Text="{Binding Path=..., UpdateSourceTrigger=...}"> 
+6
source

Source: https://habr.com/ru/post/1336632/


All Articles