I've got a CheckComboBox bound to a list consisting of one simple index and a full description like this:
code full_description
1 Bus
2 Car
3 Motobike
Is it possible to show just 1,2,3 for selected items and show full description when dropping down the list?
I found a similar question here. But since CheckComboBox using the difference implementation, I have modified the part of class ComboBoxItemTemplateSelector
as follows:
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
SelectorItem selectorItem = VisualTreeHelpers.GetVisualParent<SelectorItem>(container);
if (selectorItem != null)
{
return DropDownTemplate;
}
return SelectedTemplate;
}
It works fine with dropdown list, but no luck with selected items. I tried to dig into the source code of CheckComboBox but got nothing. Hope someone can help me out. Thanks.