0
我有ComboboxItem中有多行的组合框。但我想当我选择项目只显示一行。请参见图示: WPF Combobox - 编辑选定的文本
这是我的代码:
<ComboBox ItemsSource="{Binding Path=QuickSelectionDates}" SelectedValuePath="Value" Width="110" Height="20" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=QuickSelectionDate, UpdateSourceTrigger=PropertyChanged}" Name="QuickSelectionDatesCombo"
Margin="5 0 0 0" IsEnabled="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type library:ValueItem}">
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Description}" FontSize="11" FontWeight="Bold"/>
<TextBlock Text="{Binding AdditionalDesctiption}" FontSize="10"/> <!--DATE RANGE (second line)-->
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding QuickSelectionDateCommand}"
CommandParameter="{Binding ElementName=QuickSelectionDatesCombo, Path=SelectedValue}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
感谢您的帮助
你有足够的信息来回答这个问题吗? – bluray