Cannot get the ComboBox
in the DataGridTextColumn.Header
to bind.
The first stand alone ComboBox
binds fine.
Fields is just Public List<String>
.
<StackPanel Orientation="Vertical">
<ComboBox ItemsSource="{Binding Path=Fields}"/>
<DataGrid ItemsSource="{Binding Path=MyRows}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Width="80" Binding="{Binding Col1}">
<DataGridTextColumn.Header>
<StackPanel>
<TextBlock Text="Header1" />
<ComboBox Width="60" ItemsSource="{Binding Path=Fields}" />
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
private List<string> fields = new List<string> { "aa", "bb", "cc" };
public List<string> Fields { get { return fields; } }
even tried making Fields a Property of MyRow