Note that there are some explanatory texts on larger screens.

plurals
  1. PODataGridComboBoxColumn Binding to a List<String>
    primarykey
    data
    text
    <p>I have a WPF application that contains a datagrid. The datagrid is bound to my object OrderBlock which contains a List of type Orders.</p> <pre><code>&lt;DataGrid DataContext="{Binding OrderBlock}" Name="dataGridOrdersGood" ItemsSource="{Binding Orders}" </code></pre> <p>This works fine and displays nicely in my datagrid. There is one property (StatusGood) in my List though that I would like to display as a combobox where there can be only two values, "Send" or "Hold".</p> <p>So I was trying to bind the combobox values to the List StatusList as shown below. Then trying to bind the actual value to my object.</p> <pre><code>public class ViewModel : INotifyPropertyChanged { public List&lt;string&gt; StatusList; // constructor public ViewModel() { StatusList = new List&lt;string&gt;(); StatusList.Add("Hold"); StatusList.Add("Send"); } } &lt;DataGridComboBoxColumn Header="Status Good" SelectedItemBinding="{Binding StatusList}" SelectedValuePath="{Binding StatusGood}"/&gt; </code></pre> <p>However nothing is displayed other than a empty combobox. I do not understand why at the very least my combobox is not showing the value of my object? I am providing a list so again I do not understand why it's not showing anything.</p> <p>I'm new to WPF and must struggling to understand it. I have referenced but obviously not fully understand it. <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridcomboboxcolumn.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridcomboboxcolumn.aspx</a></p> <p>Any help would be great! Thanks, M</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    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