DataGrid combobox again!

Feb 17, 2009 at 3:36 PM
Hi,
Questions like this one have been asked before on this forum but I can't seem to get this to work.
I have a viewmodel with a list of strings called Channels. I want to show this list in a combobox on a datagrid.
I think I have to do something like in this link here. I tried copying the code from this blog and adapting it to my case.
Has anyone any idea how this should be done? So far I've created the xaml below but I don't see any items.

Thanks in advance,
  Robert
 <dg:DataGridComboBoxColumn Header="Label" Width="*"
                                           SelectedItemBinding="{Binding Path=Label}"
                                           >
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="{x:Type ComboBox}">
                            <Setter Property="ItemsSource" Value="{Binding Path=Channels}" />
                            <Setter Property="IsEditable" Value="True" />
                            <Setter Property="StaysOpenOnEdit" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                    <dg:DataGridComboBoxColumn.ElementStyle>
                        <Style TargetType="{x:Type ComboBox}">
                            <Setter Property="ItemsSource" Value="{Binding Path=Channels}" />
                        </Style>
                    </dg:DataGridComboBoxColumn.ElementStyle>
</dg:DataGridComboBoxColumn>