Displaying the selected item differently in ComboBox
- by David Brunelle
I have a combo box in which I set up an ItemTemplate that looks something like this:
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Piece.NoPiece}" Width="50" />
<TextBlock Text="{Binding Piece.Description}" Width="170" />
<TextBlock Text="{Binding Piece.Categorie.NomCategorie}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
As you can see, I got three columns that let the user see different piece of information. However, I would like the selected item in the combo to display only the second column. In other word, is there a way to have an ItemTemplate that displays items in a different manner when you scroll down versus when it's closed and you only see the selection?