回复 1楼ljf31的帖子
ljf31 你好,
可以通过 CellFactory 来定制单元格样式,参考代码:
- public class MyCellFactory : C1.Silverlight.FlexGrid.CellFactory
- {
- public override FrameworkElement CreateCell(C1.Silverlight.FlexGrid.C1FlexGrid grid, C1.Silverlight.FlexGrid.CellType cellType, C1.Silverlight.FlexGrid.CellRange range)
- {
- var cell = base.CreateCell(grid, cellType, range) as Border;
- if (cellType == C1.Silverlight.FlexGrid.CellType.Cell && range.Column == 0)
- {
- var gr = grid.Rows[range.Row] as C1.Silverlight.FlexGrid.GroupRow;
- if (gr != null && gr.HasChildren && !gr.IsCollapsed)
- {
- foreach (var tb in C1.Util.Util.GetChildrenOfType<TextBlock>(cell))
- {
- tb.Opacity = 0;
- }
- }
- }
- return cell;
- }
- }
复制代码 |