我现在在工具栏上能添加自定义按钮,就是点击按钮,事件没有触发。
- protected void ibtnSave_Click(object sender, ImageClickEventArgs e)
- {
- FpSpread1.SaveExcelToResponse("test.xls",FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
- }
- protected override void Render(HtmlTextWriter writer)
- {
- Table table = FpSpread1.FindControl("cmdTable") as Table;
-
- TableCell cell=new TableCell();
- ImageButton btn =new ImageButton();
- btn.ImageUrl = "~/Themes/Images/16/download.png";
- btn.Attributes.Add("onclick",ClientScript.GetPostBackEventReference(FpSpread1,"BtnCommand,-1,-1"+";return false"));
- btn.Click += ibtnSave_Click;
- cell.Controls.Add(btn);
- table.Rows[0].Cells.Add(cell);
- base.Render(writer);
- }
复制代码 |
|