Wpf combobox itemssource not updating

Posted by / 14-Nov-2017 20:37

Wpf combobox itemssource not updating

The issue was that my view model inherited from a base view model which implemented a property changed method.

I had a property changed event in my view model as well because I didn't realize this base view model class had one in there.

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

I'm trying to get a WPF combobox working (inside the WPFToolkit Datagrid), and I'm having trouble getting all the pieces aligned correctly.

Now, all of that aside, let’s go over the more common properties used in Data Binding to a Selector control.

Now that we’ve got a decent understanding of the common binding properties of a Selector control (I hope! Given the following classes (only class signatures; the full sample project including source code is attached to this post): Note the use of “Mode=One Way” in my Items Source bindings.

I have tried Selected Item, Selected Index, Text and nothing works for me.

At that point, the displayed value returns to the original value, not to the newly selected value.Once I removed the property changed event from my view model, everything worked just fine.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.Note that the information in this post may also be applied to other controls implementing Items Control. Along the way, I came across a situation where I needed to do some different kinds of binding using Combo Boxes.My specific case was a bit more complex because I was binding to the page View Model (which I didn’t want to instantiate more than once as it made web service calls) to a Combo Box in a Data Template for a cell in a Grid View.

wpf combobox itemssource not updating-17wpf combobox itemssource not updating-73wpf combobox itemssource not updating-56

There wasn’t much documentation regarding that which I found that was helpful, so I’ll do another post about that later.

One thought on “wpf combobox itemssource not updating”

  1. J Gould, William Dean Howells 9780879934439 0879934433 Interventional Cardiology - The Essentials for the Boards, Questions and Answers, Clinical Cases, and Pearls, Cindy L Grines, Mihaela Savu, Luis Tejada 9780786418145 0786418141 Placenames of the World - Origins and Meanings for Over 5, 000 Natural Features, Countries, Capitals, Territories, Cities and Historic Sites, Adrian Room 9780330372442 0330372440 Epitaph for a Spy, Eric Ambler 9780451215352 0451215354 Sydney Omarr's Taurus 2006, Omarr Sydney 9781869443368 1869443365 Marvellous Menus 9789051991680 9051991681 Edgar Krahn, 1894-1961 - A Centenary Volume, Jaak Peetre, U. Higgins 9781177017107 1177017105 Studi Italiani Di Filologia Classica Volume 12, Anonymous 9780324182774 0324182775 Excel and Access for accounting, Glenn Owen 9781555540524 155554052X Fefu and Her Friends, Maria Irene Fornes 9781853410208 1853410209 The Pattern of Landscape, Sylvia Crowe, Mary Mitchell 9780119669015 0119669013 Official Journal of the European Communities - Information and Notices 9780897895286 0897895282 Education and the Postmodern Condition, Michael Peters 9781585971237 1585971235 Beauticians Tell All, Denise Foster Patrick 9780316020299 031602029X Midnight Never Come, Marie Brennan 9780131936935 013193693X English Adventure, Bk.