michael 你好,
1.ColumnFooter 样式可通过 NameStyle 类设置,参考代码:- this.fpSpread1.Sheets[0].ColumnFooter.Visible = true;
- this.fpSpread1.Sheets[0].ColumnFooter.RowCount = 2;
- FarPoint.Win.Spread.NamedStyle footerStyle = new FarPoint.Win.Spread.NamedStyle();
- footerStyle.Border = new FarPoint.Win.LineBorder(System.Drawing.Color.Red, 1);
- footerStyle.BackColor = System.Drawing.Color.Green;
- footerStyle.Name="footerStyle";
- this.fpSpread1.NamedStyles.Add(footerStyle);
- this.fpSpread1.Sheets[0].ColumnFooter.DefaultStyleName = "footerStyle";
复制代码
2.该 case 可以通过 js 来实现,代码如下:- function Button1_onclick() {
- //获取表单 table
- var viewPort = this.document.getElementById("FpSpread1_view");
- var viewPortHeight = viewPort.style.height;
- var spread = document.all("FpSpread1");
- //获取单元格部分 table
- var bodyTable = this.document.getElementById("FpSpread1_viewport");
- var bodyTableHeight = bodyTable.style.height;
- //获取列头 table
- var colHeaderTable = this.document.getElementById("FpSpread1_rh");
- if (bodyTableHeight < viewPortHeight)
- {
- var rowcount = spread.GetRowCount();
- for (var i = 0; i < rowcount; i++)
- {
- //填写适当值
- //设置 列头 高度
- colHeaderTable.rows(i).style.height = "40px";
- //设置 列 高度
- bodyTable.rows(i).style.height = "40px";
- }
- }
复制代码 |