huzige0265

导航

 

<DataGridTemplateColumn Width="100" Header="实测值">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<ComboBox
Name="combobox"
Width="80"
Margin="2,0,0,2"
DisplayMemberPath="Value"
ItemsSource="{Binding ComSors}"
IsEnabled="{Binding isUnCompelete}"
SelectedIndex="0"
SelectedItem="{Binding STA, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Key"
Text="{Binding QTY, Mode=TwoWay}"
Visibility="{Binding REF_VALUE, Converter={StaticResource OKVisibilityConvertor}}" />
<TextBox
Width="80"
Height="25"
Margin="2,0,0,2"
Foreground="{Binding STATUS, Converter={StaticResource ResourceKey=ColorConvertor}}"
IsReadOnly="{Binding isCompelete, Mode=TwoWay}"  <!--这里的isCompelete值一定要是网格绑定的列表对应的值,而不是VM上面的值-->
Text="{Binding QTY, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
Visibility="{Binding REF_VALUE, Converter={StaticResource OKVisibilityConvertorText}}" />

</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

posted on 2018-12-07 22:00  huzige0265  阅读(99)  评论(0编辑  收藏  举报