您好,
1.设置公式后插入行,公式可以自动更新,测试代码如下;
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread1.Sheets[0].RowCount = 5;
- this.FpSpread1.Sheets[0].Cells[3, 0].Formula = "SUM(A1:A3)";
- this.FpSpread1.ClientAutoCalculation = true;
- this.FpSpread1.Sheets[0].Cells[0, 0].Note = "testvisible";
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- this.FpSpread1.Sheets[0].Rows.Add(1, 1);
- }
复制代码
2.设置单元格 note 后,在前台被render成 td 的 title 属性,可以通过使用 js 移除 td 的 title 属性或者将 title 属性设置为空,可以使其不显示。参考代码:
C#
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread1.Sheets[0].Cells[0, 0].Note = "testvisible";
- }
复制代码
JS
- <script type="text/javascript">
- window.onload = function () {
- var spread = this.document.getElementById("FpSpread1");
- var cell = spread.GetCellByRowCol(0, 0);
- cell.title = "";
- }
- </script>
复制代码 |
|