执行代码如下:
spread1 = new FarPoint.Win.Spread.FpSpread();
spread1.Dock = DockStyle.Fill;
this.Panel2.Controls.Add(spread1);
spread1.Sheets.Add(new FarPoint.Win.Spread.SheetView());
//设置初始值
spread1.ActiveSheet.SetValue(0, 0, 10);
spread1.ActiveSheet.SetValue(1, 0, 20);
spread1.ActiveSheet.SetFormula(3, 0, "SUM(A1:A2)");
spread1.ActiveSheet.AutoCalculation = true;
//增加一行
spread1.ActiveSheet.AddRows(2, 1);
spread1.ActiveSheet.SetValue(2, 0, spread1.ActiveSheet.Cells[4, 0].Formula); |