I am trying to add a combobox to a Xceed WPF datagrid but not able to bind Itemssource to the combo box. Here is the xaml for the datagrid.
<xwpf:DataGridControl ItemsSource="{Binding SaleDetails}" AutoCreateColumns="False" >
<xwpf:DataGridControl.Columns>
<xwpf:Column FieldName="Status" Title="Status" CellContentTemplate="{StaticResource colReinstatementType}" CellEditor="{StaticResource statusEditor}" />
</xwpf:DataGridControl.Columns>
</xwpf:DataGridControl>
Resources
<UserControl.Resources>
<DataTemplate x:Key="colReinstatementType">
<ComboBox BorderThickness="0"
x:Name="cmbStatus1"
IsReadOnly="False"
IsEditable="True"
MinHeight="20"
DisplayMemberPath="part_no"
Text="{xwpf:CellEditorBinding NotifyOnSourceUpdated=True}"
SelectedItem="{Binding Item, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding AvailablePartMaterial, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
</ComboBox>
</DataTemplate>
<xwpf:CellEditor x:Key="statusEditor">
<xwpf:CellEditor.EditTemplate>
<DataTemplate>
<ComboBox BorderThickness="0"
x:Name="cmbStatus"
IsReadOnly="False"
IsEditable="True"
MinHeight="20"
DisplayMemberPath="part_no"
Text="{xwpf:CellEditorBinding NotifyOnSourceUpdated=True}"
SelectedItem="{Binding Item, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding AvailablePartMaterial, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
</ComboBox>
</DataTemplate>
</xwpf:CellEditor.EditTemplate>
</xwpf:CellEditor>
</UserControl.Resources>
Item
and AvailablePartMaterial
do exist in the SaleSheet
type whose collection is bound to the datagrid. Even Item
property does get fired which means Selected item of the combo box is getting binded. But no data is shown in the combo box.