有时为了美观,需要更改GridView控件中某一列数据的背景色。
这里提供了一种方法。
1、前台定义并绑定集合的字段
2、在要更改颜色的列添加如下格式的代码:
<telerik:GridViewDataColumn.CellStyle>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="Background"
Value="Green" />
</Style>
</telerik:GridViewDataColumn.CellStyle>
像这样
效果如下:
同理,控制字体颜色的属性为 Foreground=“”
效果如下: