1

Selector.SelectedItemProperty is using UpdateSourceTrigger.Default, which results in PropertyChanged, and this works fine when using a combobox on any control like this:

<ComboBox SelectedItem="{Binding MyVMProperty}"/>

This will result in a two-way binding with UpdateSourceTrigger=PropertyChanged.

However when applying that same binding on a DataGridComboBoxColumn, it only updates the source on lost focus (or when the column exists edit mode):

<DataGridComboBoxColumn SelectedItemBinding="{Binding MyVMProperty}"/>

I know that I can explicitly set the UpdateSourceTrigger in the binding, but I was more curious about why it does not work the same way out of the box? The underlying Binding has UpdateSourceTrigger.Default, so I would have expected it to adhere to the mode set by the Selector.SelectedItemProperty.

sondergard
  • 3,184
  • 1
  • 16
  • 25
  • Long story short: Use TemplateColumn instead of comboboxcolumn. – Jaster Feb 21 '19 at 12:55
  • We are already subclassing the DataGridComboBoxColumn (and all the others), so we have taken the approach to clone the binding, and set the UpdateSourceTrigger manually. I was more interested in the reason behind the logic. – sondergard Feb 21 '19 at 14:29

0 Answers0