i have a combobox which is bound to a datatable column like this:
ComboBox.DataContext = DataDataTable;
ComboBox.DisplayMemberPath = DataData
You can modify the ItemTemplate
of the ComboBox
and use your converter:
<ComboBox ItemsSource="{Binding}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource IDPrefixValueConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Each item is bound to the items in the ItemsSource
. By using the converter in the binding you are able to perform the conversion you want.