I have a DATAGRID and fill it with a DataTable. The table has columns that contain an ID (ValidationID) on a DataTable PTable with different values that I want to display as a combo box in the VALIDATION column. Furthermore, the combo box should not be displayed when the CheckBox DDL is selected.
Everything works, except that I cannot fill the combo box.
...
<Window.Resources>
<CollectionViewSource x:Key="PTable" Source="{Binding PlausiTable.DefaultView}" />
</Window.Resources>
<DataGridTemplateColumn Header="VALIDATION">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate >
<ContentControl x:Name="content" Content="{Binding}" >
</ContentControl>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding DROPDOWN}" Value="0">
<Setter TargetName="content" Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<ComboBox x:Name="ddl_Plausi" ItemsSource="{Binding Source={StaticResource PTable}}"
DisplayMemberPath="ID"
SelectedItem="{Binding ValidationCheckID, Mode=TwoWay}"
SelectedValuePath="NAME" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding DROPDOWN}" Value="1">
<Setter TargetName="content" Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<ComboBox Visibility="Hidden" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background"
Value="{StaticResource clBr}" />
</Style>
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
...
No matter what I try, the ComboBox remains empty. All other columns work in this way without any problems. Screenshot