回复 1楼liuyong的帖子
liuyong 你好,
参考代码如下:
C#:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread2.Sheets[0].Rows.Count = 0;
- }
- protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- this.FpSpread2.Sheets[0].Rows.Add(this.FpSpread2.Sheets[0].Rows.Count, 1);
- this.FpSpread2.SaveChanges();
- }
- protected override void Render(HtmlTextWriter writer)
- {
- Table update = this.FpSpread1.FindControl("viewport") as Table;
- update.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(FpSpread1, "Button,-1,-1") + "; return false;");
- base.Render(writer);
- }
复制代码 |