Wpf combobox binding selecteditem not updating

When i change the combo box, the source property is being updated fine, but when I change the source property or when the control is initialized, the event and the Trace Source output shows me that the binding detected it and transferred the value, its just that the combobox isn't reflecting it. EDIT: output from the trace source is this: System. Data Warning: 91 : Binding Expression (hash=23631369): Got Property Changed event from Report View Model (hash=52844413) System. Data Warning: 97 : Binding Expression (hash=23631369): Get Value at level 0 from Report View Model (hash=52844413) using Runtime Property Info(Sub Grouping View): Data Column View Model (hash=58231222) System. Data Warning: 76 : Binding Expression (hash=23631369): Transfer Value - got raw value Data Column View Model (hash=58231222) System. Data Warning: 80 : Binding Expression (hash=23631369): Transfer Value - implicit converter produced Data Column View Model (hash=58231222) System. Data Warning: 85 : Binding Expression (hash=23631369): Transfer Value - using final value Data Column View Model (hash=58231222) The object returned from your Sub Grouping View must be "equal" to one of the objects in the Combo Box. If they are functionally the same, but not returning true when compared then that's your problem. (cant award bounty for another three hours tho)It's hard to say definitively, since every situation is different.

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. If you're View Model isn't used in Items Controls, then it may not matter if you override Equals. I think the whole answer is to implement full IEquatable that means implementing its Equals method and overriding Object. Get Hash Code methods as in this example (see the end of "Remarks" section - "Notes to Implementers" - and "Examples" section).

https://rachel53461.wordpress.com/2011/08/20/comboboxs-selecteditem-not-displaying/ You can override the equals property on your object so that it returns true if the items have the same data.I also thought I should attach my Raise Property method and event, just in case it is of importance to my problem: Here is the event: Hi Stephen, Could you please try setting Selected Value instead of Selected Item? However, we will research further why Selected Item is not set correctly. All the best, Yana the Telerik team We finally got it figured out.The issue was that my view model inherited from a base view model which implemented a property changed method. No matter what I do, I cannot get the UI to change when I set the Selected Item property via the View Model.I have tried Selected Item, Selected Index, Text and nothing works for me.

Leave a Reply