WPF DevExpress中GridControl动态修改行背景颜色 - 借用的
<dxg:TableView.RowStyle>
<Style TargetType="dxg:GridRowContent" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}">
<Setter Property="Background" Value="{Binding Row.USER_ID, Converter={StaticResource conv}}"/>
</Style>
</dxg:TableView.RowStyle>
提示:“GridRowContent”TargetType 与元素“RowControl”的类型不匹配。
在dxg:TableView 中设置UseLightweightTemplates 为None 就可以了。
<dxg:GridControl.View>
<dxg:TableView AllowPerPixelScrolling="True" Name="tvSAP" AllowEditing="False" ShowTotalSummary="False" ShowGroupPanel="False" UseLightweightTemplates="None">
<dxg:TableView.RowStyle>
<Style TargetType="dxg:GridRowContent" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}">
<Setter Property="Background" Value="{Binding Row.ComponentCode, Converter={StaticResource NewSAPCodeConvert}}"/>
</Style>
</dxg:TableView.RowStyle>
</dxg:TableView>
</dxg:GridControl.View>

浙公网安备 33010602011771号