Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you attempting to bind the <code>DataGridComboBoxColumn</code>'s <code>ItemsSource</code> property to an <code>ObservableCollection</code> (PlatformsCollection) or to a Property (Platform)?</p> <p>You should be able to accomplish this with something like..</p> <pre><code>&lt;DataGridComboBoxColumn Header="Platform" ItemsSource="{Binding PlatformsCollection}" SelectedValue="{Binding SelectedPlatform}" DisplayMemberPath="PlatformName"/&gt; </code></pre> <p><strong>You'll need to add another member to your model called SelectedPlatform which will store/update each time the user changes the selected platform.</strong></p> <p>Additionally, you may want to look into using a <code>CellTemplate</code>/<code>CellEditingTemplate</code> combination with a <code>DataGridTemplateColumn</code> for this which looks a bit nicer. The user is only presented with a textbox unless they click into the cell at which point the combobox would appear.</p> <p>The markup for this would be something like</p> <pre><code>&lt;DataGridTemplateColumn&gt; &lt;DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding SelectedPlatform.PlatformName}"/&gt; &lt;/DataTemplate&gt; &lt;/DataGridTemplateColumn.CellTemplate&gt; &lt;DataGridTemplateColumn.CellEditingTemplate&gt; &lt;DataTemplate&gt; &lt;ComboBox ItemsSource="{Binding PlatformsCollection}" SelectedValue="{Binding SelectedPlatform}" DisplayMemberPath="PlatformName"/&gt; &lt;/DataTemplate&gt; &lt;/DataGridTemplateColumn.CellEditingTemplate&gt; &lt;/DataGridTemplateColumn </code></pre> <p>Hopefully that helps. Let me know if you have any questions.</p>
    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.
    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