回复 1楼mountain2657的帖子
可以出发后台事件,需要通过后台添加前台点击事件,结合 CallBack 方法进行处理:
- protected override void Render(HtmlTextWriter writer)
- {
- //行头ID为 rh,普通表单为 viewport
- Table viewport = this.FpSpread1.FindControl("rh") as Table;
- int rowcount = 0;
- int colcount = 0;
- if (viewport != null)
- {
- rowcount = viewport.Rows.Count;
- colcount = viewport.Rows[0].Cells.Count;
- }
- //点击第一行出发排序
- for (int j = 0; j < rowcount; j++)
- {
- viewport.Rows[j].Cells[0].Attributes.Add("ondblclick", "spreadcallback()");
- }
- base.Render(writer);
- }
- protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- }
复制代码
前台代码:
- <script type="text/javascript">
- function spreadcallback() {
- var spread = this.document.getElementById("FpSpread1");
- spread.CallBack("button");
- }
- </script>
复制代码 |