回复 3楼KNight的帖子
GetCellRange是获取一片单元格。
如果你的需求是对当个单元格的Style设置,可以创建CellFactory。
有关CellFactory的创建,可以参考C1FlexGrid for Silverlight英文帮助文档:
http://helpcentral.componentone. ... mcellsincodecel.htm
一些代码片段参考:
- flex.CellFactory = new MyCellFactory();
-
- public class MyCellFactory : CellFactory
- {
- public override void ApplyCellStyles(C1FlexGrid grid, CellType cellType, CellRange range, Border bdr)
- {
- var columnindex = range.Column;
- var rowindex = range.Row;
- var _textblock = bdr.Child as TextBlock;
-
- if ((columnindex == 2) && (rowindex == 3))
- {
- bdr.Background = new SolidColorBrush(Colors.Red);
- bdr.BorderBrush = Brushes.Blue;
- bdr.BorderThickness = new Thickness(1);
- _textblock.TextDecorations = TextDecorations.Underline;
- _textblock.FontWeight = FontWeights.Bold;
- _textblock.FontSize = 15;
- _textblock.FontStyle = FontStyles.Italic;
- }
- }
- }
复制代码 |