回复 9楼xujingtian的帖子
你好,
需要调用后台代码设置 Border:
C#
- protected override void Render(HtmlTextWriter writer)
- {
- Table tb = this.FpSpread1.FindControl("viewport") as Table;
- tb.Attributes.Add("onclick", "CellClick()");
- base.Render(writer);
- }
- protected void FpSpread1_ButtonCommand(object sender, SpreadCommandEventArgs e)
- {
- int column=this.FpSpread1.ActiveSheetView.ActiveColumn;
- int row=this.FpSpread1.ActiveSheetView.ActiveRow;
- this.FpSpread1.ActiveSheetView.Cells[row, column].Border = new Border(BorderStyle.Solid, System.Drawing.Color.Red, 2);
- }
复制代码
JS:
- <script type="text/javascript">
- function CellClick() {
- var spread = this.document.getElementById("FpSpread1");
- var row = spread.ActiveRow;
- var col = spread.ActiveCol;
- spread.CallBack("button")
- }
- </script>
复制代码
如果需要清除 Border,可以在 下次进入 ButtonCommand 事件后,通过 ResetBorder 方法,先清除之前单元格的 Border。 |