回复 1楼summonyyq的帖子
实现代码如下:
- protected override void Render(HtmlTextWriter writer)
- {
- Table tb = this.FpSpread1.FindControl("cht") as Table;
- if (tb!=null)
- {
- int rowcount = tb.Rows.Count;
- int colCount = tb.Rows[0].Cells.Count;
- for (int i = 0; i < rowcount; i++)
- {
- for (int j = 0; j < colCount; j++)
- {
- tb.Rows[i].Cells[j].Attributes.Add("onclick", "javascript:document.getElementById('FpSpread1').SortColumn("+i.ToString()+"); return false;");
- }
- }
- }
-
- base.Render(writer);
- }
复制代码 |