Hello,
I have a RadcomboBox with Multiple Selection allowed. The ItemSource of this combo is a enum.
public enum WorkStatus {
[Description("WORKING")]
Working,
[Description("NOT WORKING")]
Not_Working,
[Description("WORKING WITH ERRORS")]
Working_with_errors,
[Description("STOPPED")]
Stopped
}
And this is my code:
<Window x:Class="MultiSelectComboboxEnums.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:MultiSelectComboboxEnums"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="MainWindow"
Height="350"
Width="525">
<Window.Resources>
<ObjectDataProvider x:Key="statesWork"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:WorkStatus" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<local:EnumToFriendlyNameConverter x:Key="enumToFriendlyNameConverter" />
</Window.Resources>
<Grid>
<telerik:RadComboBox Width="350"
Height="26"
Margin="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
telerik:StyleManager.Theme="Windows8"
ItemsSource="{Binding Source={StaticResource statesWork}}"
ClearSelectionButtonVisibility="Visible"
IsSynchronizedWithCurrentItem="False"
AllowMultipleSelection="True"
MultipleSelectionSeparator="|"
MultipleSelectionSeparatorStringFormat="{} {0} ">
<telerik:RadComboBox.ItemTemplate>
<DataTemplate>
<Label Height="Auto"
Margin="0"
VerticalAlignment="Center"
Content="{Binding Path=., Mode=OneWay, Converter={StaticResource enumToFriendlyNameConverter}}" />
</DataTemplate>
</telerik:RadComboBox.ItemTemplate>
</telerik:RadComboBox>
</Grid>
</Window>
In dropdown item I can see the correct name using a converter but how can I do to see the same in the selected items box?
I attached two images showing this error.
Thanks in advance.