可以稍作修改,在非编辑状态,默认的是一个textblack,设置其foregound即可
- public class MyCellFactory : CellFactory
- {
- public override void ApplyCellStyles(C1FlexGrid grid, CellType cellType, CellRange rng, Border bdr)
- {
- var columnindex = rng.Column;
- var rowindex = rng.Row;
- if ((columnindex == 2) && (rowindex == 3))
- {
- if(bdr.Child is TextBlock)
- {
- (bdr.Child as TextBlock).Foreground = new SolidColorBrush(Colors.Red);
- }
-
- // set the customizations on the cell when it is not selected
-
- bdr.BorderBrush = Brushes.Blue;
- bdr.BorderThickness = new Thickness(1);
- }
- }
- }
复制代码 |