回复 7楼lonely红茶的帖子
stylename 类可以设置单元格的样式,参考代码如下:
- gcSpreadSheet1.Sheets[0].NamedStyles.Add(new GrapeCity.Windows.SpreadSheet.Data.StyleInfo() { Background = new SolidColorBrush(Colors.Red), Name = "aaa", VerticalAlignment = GrapeCity.Windows.SpreadSheet.Data.CellVerticalAlignment.Center });
- var style = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
- gcSpreadSheet1.Sheets[0].Cells[0, 0].StyleName = "aaa";
- gcSpreadSheet1.Sheets[0].Rows[7].StyleName = "aaa";
- //set rowheader`s style
- gcSpreadSheet1.Sheets[0].RowHeader.Columns[0].StyleName = "aaa";
- style.Background = new SolidColorBrush(Colors.Blue);
- style.BorderLeft = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
- style.BorderTop = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
- style.BorderRight = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
- style.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
复制代码 |