回复 3楼kamehameha的帖子
前台代码:
- <script type="text/javascript">
- function cellclick() {
- var spread=this.document.getElementById("<%=this.FpSpread1.ClientID%>");
- var activeRow=spread.ActiveRow;
- var activeCol=spread.ActiveCol;
- var cell = spread.GetCellByRowCol(activeRow, activeCol);
- cell.bgColor = "red";
- }
- </script>
复制代码
后台代码:
- protected override void Render(HtmlTextWriter writer)
- {
- Table _viewPort = this.FpSpread1.FindControl("viewport") as Table;
- _viewPort.Attributes.Add("onclick", "return cellclick()");
- base.Render(writer);
- }
复制代码 |