Reputation: 1042
I'm trying to create a DataTemplate for my class so the ComboBox displays two properties and then a separator. The problem is that I don't want to see a separator once I selected an item. My current template looks like this:
<DataTemplate DataType="{x:Type j:Person}">
<StackPanel>
<TextBlock Text="{Binding Nick}" FontSize="14"></TextBlock>
<TextBlock Text="{Binding FullName}"></TextBlock>
<Separator/>
</StackPanel>
</DataTemplate>
Another problem is that the Separator is too short, it doesn't span the entire ComboBox width.
Any help appreciated.
Upvotes: 0
Views: 1299
Reputation: 436
To stretch the Separator
please use HorizontalContentAlignment="Stretch"
on the ComboBox
. Regarding the hiding of the Separator
this could help: Displaying the selected item differently in ComboBox.
Upvotes: 2