I have a combobox bound to a datatable. It has lot of records in it with long text.
I have set the display member path to show all the text but obviously that will take up lot of screen space. So, when the user clicks the dropdown I want to show the full display member path but upon selection I want to show maybe just first 10 characters? As shown this image.
Is there any way I can do this?
<ComboBox Name="Texas_AON" IsEditable="True"
Grid.Row="0" Grid.Column="1" Visibility="{Binding Source='TX_ASL', Converter={local:NistRuleToVisibilityConverter}, ConverterParameter='97'}"
ItemsSource="{Binding Data.Tables[TxOffenseCodes]}"
SelectedValuePath="Code"
DisplayMemberPath="Description"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.IsContainerVirtualizable="True" VirtualizingStackPanel.IsVirtualizingWhenGrouping="True"
Style="{DynamicResource PerformanceComboBox}" Margin="2" FontSize="12" >
<ComboBox.SelectedValue>
<Binding Path="NF.t2.Texas412.Offenses[0].AON" Mode="TwoWay" ValidatesOnDataErrors="True" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" ValidatesOnExceptions="True" >
<Binding.ValidationRules>
<local:FieldValidator ValidatesOnTargetUpdated="True" FieldName="AON" FieldNum="97"/>
</Binding.ValidationRules>
</Binding>
</ComboBox.SelectedValue>
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>