没有这样的方法可以直接判断当前sheet的所有border并修改颜色,可以通过遍历单元格设置:
- var rc = sheet.getRowCount();
- var cc= sheet.getColumnCount();
- sheet.suspendPaint();
- for(var r=0; r<rc; r++) {
- for(var c=0; c<cc; c++) {
- var border = new GC.Spread.Sheets.LineBorder("black",GC.Spread.Sheets.LineStyle.thin);
- var borderTop = sheet.getCell(r,c).borderTop();
- var borderBottom = sheet.getCell(r,c).borderBottom();
- var borderLeft = sheet.getCell(r,c).borderLeft();
- var borderRight = sheet.getCell(r,c).borderLeft();
- if(borderTop || borderBottom || borderLeft || borderRight) {
- sheet.getCell(r,c).borderTop(border).borderBottom(border).borderLeft(border).borderRight(border);
- }
-
- }
- }
- sheet.resumePaint();
复制代码
|