sam 你好,不好意思,久等了:
需要在给 Label 赋值之前,调用 FpSpread 下 SaveChanges 方法进行前台赋值保存到后台,代码如下( myspread.SaveChanges() 用于同步前台变化):- private void SaveUserFromData_Click(object sender, EventArgs e)
- {
- if (Mycontrol != null)
- {
- FarPoint.Web.Spread.FpSpread myspread = new FpSpread();
- myspread = ((FarPoint.Web.Spread.FpSpread)Mycontrol);
- myspread.SaveChanges();
- int p = myspread.ActiveSheetView.Rows.Count;
- ((Label)Mycontrol2).Text = "第一个单元格的值为:" + ((FarPoint.Web.Spread.FpSpread)Mycontrol).ActiveSheetView.Cells[0, 0].Text.ToString();
- ((Label)Mycontrol3).Text = "表格总行数为:" + p.ToString();
- }
- }
复制代码 |