I'm trying, without success, to fill a combobox with string representation of enums and bind to data. I'm able to do this in a dialog but when I try to apply the same logic to a combobox embedded in a gridview it doesn't work. I've been banging my head against the wall on this one for the better part of a day. Any help would be greatly appreciated. Thank you.
Up top in both files:
xmlns:converters="clr-namespace:tpx.MMaker.MVVM.Net.PositionProfile.Converter"
xmlns:Enums="clr-namespace:tpx.MMaker.MessageModel.Net.Enums"
Working code:
ComboBox Grid.Row="4" Grid.Column="1" ItemsSource="{Binding SkewTypes}"
SelectedValue="{Binding optionClass.UsePrintSkew, Converter={StaticResource enumDescriptionConverter},
ConverterParameter='tpx.MMaker.MessageModel.Net.Enums.SkewTypes, tpx.MMaker.MessageModel.Net'}"
Non working code with line I want to fix commented out:
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Header=" Account " Width="auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Account}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header=" Contract " Width="auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Contract}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header=" Formula " Width="auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Formula}" />
</DataTemplate>
</GridViewColumn.CellTemplate>