版权声明:我不生产代码,我只是代码的搬运工。 https://blog.csdn.net/qq_43307934/article/details/83098147
有时为了美观,需要将GridView控件中某一列数据的颜色。
这里提供了一种方法。
1、前台独立定义并绑定集合的字段
2、在要更改颜色的列添加如下格式的代码:
<telerik:GridViewDataColumn.CellStyle>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="Background"
Value="Green" />
</Style>
</telerik:GridViewDataColumn.CellStyle>
像这样
效果如下:
同理,控制字体颜色的属性为 Foreground=“”
效果如下: