回复 2楼flycatki的帖子
你好,下面是我的实现方法:
后台:
- protected void Button1_Click(object sender, EventArgs e)
- {
- this.FpSpread1.Sheets[0].RowCount++;
- this.FpSpread1.Sheets[0].SelectionModel.ClearSelection();
- this.FpSpread1.Sheets[0].ActiveRow = this.FpSpread1.Sheets[0].RowCount - 1;
- this.FpSpread1.Sheets[0].ActiveColumn = 0;
- this.FpSpread1.Sheets[0].Cells[this.FpSpread1.Sheets[0].ActiveRow, this.FpSpread1.Sheets[0].ActiveColumn].BackColor = System.Drawing.Color.Red;
- }
复制代码
前台获取当前活跃单元格:
- <script language="javascript" type="text/javascript">
- // <![CDATA[
- function Button2_onclick() {
- var spread = this.document.getElementById("<%=FpSpread1.ClientID %>");
- alert("当前活跃单元格为行"+spread.ActiveRow+"列"+spread.ActiveCol);
- }
- // ]]>
- </script>
复制代码 |