Hi,
I'm having trouble displaying a combox as a cell content in the datagrid.
I'm using a DataSet as the DataContext. I currently have two tables:
1. The data for the grid (named ItemList with the columns Name and UnitId)
2. The the data for the combobox (named Units with the columns Id and Description)
The column UnitId in table ItemList references (one-to-many) the column Id in Units.
The XAML looks like this:
<xcdg:DataGridControl ItemsSource="{Binding Path=ItemList}" AutoCreateColumns="False">
<xcdg:DataGridControl.Columns>
<xcdg:Column Title="Name" FieldName="Name" />
<xcdg:Column FieldName="UnitId" Title="Unit">
<xcdg:Column.CellEditor>
<xcdg:CellEditor>
<xcdg:CellEditor.EditTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Path=Units}"
SelectedValuePath="Id"
DisplayMemberPath="Description"
SelectedValue="{xcdg:CellEditorBinding}" />
</DataTemplate>
</xcdg:CellEditor.EditTemplate>
</xcdg:CellEditor>
</xcdg:Column.CellEditor>
</xcdg:Column>
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
The problem is that the combobox is empty when I try to edit the cells content.