Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight 4 MVVM ComboBox data binding is not being displayed
    primarykey
    data
    text
    <p>I have a ComboBox with the following XAML</p> <pre><code>&lt;ComboBox Name="CompanyComboBox" ItemsSource="{Binding Path=CompanyList, Mode=OneWay}" SelectedItem="{Binding Path=CurrentCompany, Mode=TwoWay}" DisplayMemberPath="Name" /&gt; </code></pre> <blockquote> <p><strong>Problem:</strong></p> <p>The selected option on 'company' is persisted, but never gets displayed on load. What's missing or going wrong, or what have I forgotten to do?</p> </blockquote> <ul> <li>CompanyList has data, and the ComboBox does get populated</li> <li>The selection on the ComboBox does save to the database via the TwoWayBinding</li> <li><a href="http://pastebin.com/SJYGMzs0" rel="nofollow noreferrer">More code is on pastebin.com</a>, the ViewModel and the Company class code.</li> </ul> <p>I have tried the following suggestions, <strong>that have so far not solve the issue</strong>:</p> <ol> <li><a href="https://stackoverflow.com/questions/3729146/two-way-bind-a-combobox-to-a-simple-string-array">Two-way bind a combobox to a simple string array</a> Order of ItemSource and SelectedValue properties on were correct</li> <li><a href="https://stackoverflow.com/questions/247413/wpf-combobox-selectedvalue-not-updating-from-binding-source">ComboBox.SelectedValue not updating from binding source</a> alternating between 'SelectedValue' and 'SelectedIndex' - neither works</li> <li><a href="https://stackoverflow.com/questions/3554174/silverlight-4-combobox-with-selectedvalue-using-mvvm-light">Silverlight 4 Combobox with selectedValue using MVVM-Light</a> raising PropertyChanged before setting new value also didn't help</li> <li>Adding/Removing 'IsEnabled="{Binding IsReady}' on the ComboBox didn't help either</li> <li>Adding SelectedValuePath="Name" or ="Value" stopped the save from working</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload