回复 4楼syl000216的帖子
如果需要和
后台:
- protected override void Render(HtmlTextWriter writer)
- {
- Table tb = this.FpSpread1.FindControl("cht") as Table;
- for (int i = 0; i < tb.Rows.Count; i++)
- {
- for (int j = 0; j < tb.Rows[0].Cells.Count; j++)
- {
- tb.Rows[i].Cells[j].Attributes.Add("onclick", "test(" + j.ToString() + ")");
- }
- }
- base.Render(writer);
- }
复制代码
前台:
需要先清除选择范围 ClearSelection(),再通过 FpSpread1.AddSelection 方法重新设置选择区域。
- <SCRIPT language=javascript>
- function addSelRanges() {
- FpSpread1.AddSelection(0,0,1,1); // adds a selection
- FpSpread1.AddSelection(2,2,1,1); // adds another selection
- }
- </SCRIPT>
复制代码 |