Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a DataGrid with a column that looks like:

<DataGridTemplateColumn Header="Thing">
  <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
      <TextBlock Text="{Binding Path=ThingName}"/>
    </DataTemplate>
  </DataGridTemplateColumn.CellTemplate>
  <DataGridTemplateColumn.CellEditingTemplate>
    <DataTemplate>
      <myui:AutoCombo ItemsSource="{Binding Things}"
                      SelectedValue="{Binding ThingId, UpdateSourceTrigger=PropertyChanged}"
                      DisplayMemberPath="ThingName"
                      SelectedValuePath="ThingId"/>
    </DataTemplate>
  </DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

myui:AutoCombo is a very minimal extension of System.Windows.Controls.ComboBox, only changing its Items.Filter under certain circumstances.

Things is an ObservableCollection. Both the cell template and the cell editing template display correctly, and populate correctly on form load. Additionally, when the SelectedValue property is changed by the user, ThingId is correctly changed.

However, if some code-behind changes the contents of Things, the dropdown is not re-populated. I wonder why, and how to get this to work?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.