Wpf combobox binding selecteditem not updating

Then when the combo box box goes to check to make sure your item is in the selection it will find a match.

What seems to be the issue is that the Selected Value/Selected Item is occurring before the Item source is finished loading.

The object is returning the correct object via the get in the property though.

I'm not sure if this is just an issue with the way the Combo Box and MVVM pattern works. I have had similar issues and it was solved by making sure I was implementing IEquatable properly.

It is described here for anyone with the same problem: stackoverflow.com/questions/33739513/… I have noticed that the Selected Index property doesn't cause the same bug.

The reason why it was so hard for me to pin this down is because the collections for the combos populated just fine, when I had my property changed event in my view model.

My example data item doesn't implement INotify Property Changed, but our actual data items do, so they update correctly.

No matter what I do, I cannot get the UI to change when I set the Selected Item property via the View Model.

In my case I was using in complex type (List) as the Item Source and was using a Key Type as the selected value. Selecting a color was possible but it wasnt displayed when the selection closed (although the property was changed!

On the load event, the Key Type was getting set to null. None of the sub elements would get updated when the key changed. ) The fix was overwriting the Equals(object obj) method for the type selected in the Combo Box (Brush), which wasnt simple because Brush is sealed.

Search for wpf combobox binding selecteditem not updating:

wpf combobox binding selecteditem not updating-12wpf combobox binding selecteditem not updating-40wpf combobox binding selecteditem not updating-3wpf combobox binding selecteditem not updating-45

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “wpf combobox binding selecteditem not updating”

  1. It’s free to watch, but the real fun starts when you start earning tokens and interacting with the performers. The first thing you’ll notice when you visit Slut Roulette is how similar it looks to chatroulette.

  2. VERY sexy cam girl who loves to show the world her super sexy body and awesome attitude. This amateur porn site Amateur Cool has quite a lot more sexy hotties, so be sure to checkout his page too.