Use converter on bound items in combobox

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)