【发布时间】:2018-06-11 17:03:41
【问题描述】:
我有一个数据网格,我在其中声明了一个带有组合框的模板列。 我的第一个想法是在 PreparingCellForEdit 上触发 Interaction.Trigger,但是带有组合的模板列没有触发它。 我试图将交互触发器放在组合上,它甚至没有触发 DropDown
<WPFCtrlD:ExtDataGridTemplateColumn Header="{x:Static Translate:Translate.About}" Width="*" Tag="ID_SAP_MAPPING"
IsReadOnly="False" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<!--Visibility="{Binding IsClassSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource BoolToVisibilityCollapsedInverteConverter }}"-->
<ComboBox ItemsSource="{Binding DataContext.characteristicFiltered,
Source={StaticResource ProxyElement}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged }"
SelectedValuePath="ID_SAP_NAME"
DisplayMemberPath="ID_SAP_NAME"
>
<i:Interaction.Triggers>
<i:EventTrigger EventName="DropDown">
<WPFCtrl:EventToCommand
PassEventArgsToCommand="True"
Command="{Binding DataContext.PreparingCellForEditCommand, Source={StaticResource ProxyElement}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
<!--<Label Visibility="{Binding IsClassNotSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource BoolToVisibilityCollapsedInverteConverter }}"/>-->
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</WPFCtrlD:ExtDataGridTemplateColumn>
知道如何在组合下拉菜单打开之前为我的命令触发事件吗?
谢谢 安德烈亚
【问题讨论】:
标签: wpf mvvm combobox datagridtemplatecolumn