c1:C1FlexGrid 中嵌套ComboBox 控件,数据源有时不能绑定显示:如下前台代码中有两列是同样嵌套的ComboBox控件,同样方式绑定后台DataTable数据源,
但第一列数据就可以正常绑定,第二列控件有时绑定不上,单元格显示空。
<c1:Column ColumnName="GeninFlg" Header="GeninFlg">
<c1:Column.CellTemplate>
<DataTemplate>
<ComboBox Tag="GeninFlg" ----- 可以正常绑定显示
VerticalContentAlignment="Center"
DisplayMemberPath="DisplayValue"
ItemsSource="{Binding DataContext.DtEditReason, RelativeSource={RelativeSource AncestorType=Window}}"
SelectedValue="{Binding GeninFlg, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Value"
cal:Action.TargetWithoutContext="{Binding DataContext,RelativeSource={RelativeSource AncestorType=Window}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cal:ActionMessage MethodName="FgGendatSelectionChanged">
<calarameter Value="{Binding RelativeSource={RelativeSource AncestorType=c1:C1FlexGrid}}"/>
<calarameter Value="$eventArgs"/>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</DataTemplate>
</c1:Column.CellTemplate>
</c1:Column>
<c1:Column ColumnName="missyoin" Header="missyoin">
<c1:Column.CellTemplate>
<DataTemplate>
<ComboBox Tag="missyoin" ----- 不能正常绑定显示
VerticalContentAlignment="Center"
DisplayMemberPath="DisplayValue"
ItemsSource="{Binding DataContext.DtMissReason, RelativeSource={RelativeSource AncestorType=Window}}"
SelectedValue="{Binding missyoin, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Value"
cal:Action.TargetWithoutContext="{Binding DataContext,RelativeSource={RelativeSource AncestorType=Window}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cal:ActionMessage MethodName="FgGendatSelectionChanged">
<calarameter Value="{Binding RelativeSource={RelativeSource AncestorType=c1:C1FlexGrid}}"/>
<calarameter Value="$eventArgs"/>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</DataTemplate>
</c1:Column.CellTemplate>
</c1:Column>
显示界面:
请提供下解决思路。
|