回复 21楼ken6412的帖子
可以通过 UpdateCommand 更改,参考代码如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread1.PreRender += new EventHandler(FpSpread1_PreRender);
- this.HiddenField1.Value = "fdsfasd";
- }
- void FpSpread1_PreRender(object sender, EventArgs e)
- {
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- }
- protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- this.HiddenField1.Value = this.FpSpread1.Sheets[0].ActiveColumn.ToString();
- }
- protected override void Render(HtmlTextWriter writer)
- {
- WebControl update = this.FpSpread1.FindControl("Update") as WebControl;
- update.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(FpSpread1, "Update,-1,-1") + "; return false;");
- base.Render(writer);
- }
复制代码 |