how can I specify MultipleSelectionBoxTemplate which i can access properties of selected items ?
i have an employee class
public class Employee { public string Firstname {get;set;} public string Lastname {get;set;} }
I am using Telerik radCombobox in my wpf application to display list of employee
<telerik:RadComboBox x:Name="radComboBox"
Width="200"
AllowMultipleSelection="True"
ItemsSource="{Binding Path=EmployeeList}"
>
<telerik:RadComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Lastname}" />
</DataTemplate>
</telerik:RadComboBox.ItemTemplate>
note: this code simplified , i have to use ItemTemplate because i set textblock style based on some condition
this works fine for item template but when i select an item the display text in combobox show full name of Employee class (namespace + class name ) not the Lastname
i tried
<telerik:RadComboBox.MultipleSelectionBoxTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Lastname}" />
</DataTemplate>
</telerik:RadComboBox.MultipleSelectionBoxTemplate>
i get no result , the combobox displayvalue of selected item is always empty.
i tried another solution
<telerik:RadComboBox.MultipleSelectionBoxTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedItems,Converter={StaticResource SelectionToCustomStringCoverter}}" />
</DataTemplate>
</telerik:RadComboBox.MultipleSelectionBoxTemplate>
this neither work , the converter always execute at first selection
this is really crazy spending 4 hours to figure out a simple thing ,
so my question is how can i specify MultipleSelectionBoxTemplate which i can access properties of selected items .