自定义一个CellFactory
- public class CustomCellFactory : CellFactory
- {
- public override void CreateRowHeaderContent(C1FlexGrid grid, Border bdr, CellRange rng)
- {
- if (rng.Column == 0)
- {
- bdr.Child = new TextBlock() { Text = rng.Row.ToString(),HorizontalAlignment= HorizontalAlignment.Center };
- }
- }
- }
复制代码
给grid使用
- grid.CellFactory= new CustomCellFactory();
复制代码
最终效果
|