Wpf combobox not updating when source updates
I am using INotify Property Changed in my code behind to notify when "Selected Person" is changed.
This appears to work fine updating the Text Block, but for some reason, Combo Box isn't updating with the new "Full Name".
The combo Box Dropdown just updates the first time it is opened and doesn't update after that.
So if I edit the First Name in the textbox and click the dropdown and then edit it some more and click the dropdown again, we end up with 3 different 'Full Name' values being displayed for the Selected Person.
I have created a simplified example illustrate this problem. So in the image above, I have a Text Block (in black) that shows the 'Selected Person. The First Name and Last Name properties of the Selected Person are shown in the 2 Text Boxes below the Full Name.
The Combo Box Display Member Path is bound to 'Full Name' and the combobox contains a list of Person objects.
Items (which means it must be in your Columns collection). You would need to either return the same object, or override the Equals method (and potentially the == and ! If this is your issue, it's the same problem as in this question.
I have an updating issue with Binding in my Combo Box.
What I wanted to do was bind the items in the Combo Box to a list in my View Model and to track the currently selected item.
I’m not sure yet whether using Collection View is a better approach than the alternatives I have seen which bind the Selected Value or Selected Item property.
I would be interested to hear in the comments if you think either approach has benefits over the other.
If I set up a new WPF application in Visual Studio 2010 and add the following code XAML, a data grid opens with comboboxes inside.
The problem now is that changeing a value through a combobox does not get propagated to the bound data model.
Search for wpf combobox not updating when source updates:
Both contain a Combo Box that is filled with the list from the resource section. My Item List is the list of choices bound to Combo Box. I suspect you'll need to make the Selected Item binding update the source on Property Changed for this to work.