I have the following ComboBox
<ComboBox x:Name="TaskText" Text="{Binding TaskNameBinding}" ItemsSource="{Binding
taskList, ElementName=MainWin}" SelectedValuePath="_id" DisplayMemberPath="_name"
Background="Yellow" Padding="0" Margin="0" BorderThickness="0" Width="90"/>
I wish to apply Text Wrapping to this combobox and followed to code snippet from the answer here
<ComboBox x:Name="TaskText" ItemsSource="{Binding taskList, ElementName=MainWin}"
SelectedValuePath="_id" DisplayMemberPath="_name" Background="Yellow" Padding="0"
Margin="0" BorderThickness="0" Width="90">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding TaskNameBinding}"
TextTrimming="CharacterEllipsis" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
But this template is breaking the binding and the combobox displays no values. Any help would be appreciated
Figured it out
<ComboBox x:Name="TaskText" Text="{Binding TaskNameBinding}" ItemsSource="{Binding taskList, ElementName=MainWin}" SelectedValuePath="_id" DisplayMemberPath="_name" Background="Yellow" Padding="0" Margin="0" BorderThickness="0" Width="90">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding _name}"
TextWrapping="Wrap" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>