ComboBox wpf not item not being selected

Posted by Greg R on Stack Overflow See other posts from Stack Overflow or by Greg R
Published on 2010-03-20T22:54:18Z Indexed on 2010/03/20 23:01 UTC
Read the original article Hit count: 575

Filed under:
|

I am trying to bind a combo box to a list of objects, and it works great, besides the selected value, am I missing somethign?

<ComboBox ItemsSource="{Binding OrderInfoVm.AllCountries}"
          SelectedValuePath="country_code" DisplayMemberPath="country_name" 
          SelectedValue="{Binding OrderInfoVm.BillingCountry}" />

Basically I want to bind value to country codes and set the selected value to the country code bound to OrderInfoVm.BillingCountry (which implements INotifyPropertyChanged)

Initially when the control loads selected value is empty, but on click BillingCountry is populated. Selected value does not seem to change. How can I remedy that?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about wpf-binding