没有现成的Copy方法,不过可以用以下代码实现Sheet的Copy操作
- private void btnCopy_Click(object sender, EventArgs e)
- {
- this.fpSpread1.Sheets.Add(CopySheet(fpSpread1.ActiveSheet));
- }
- public FarPoint.Win.Spread.SheetView CopySheet(FarPoint.Win.Spread.SheetView sheet)
- {
- FarPoint.Win.Spread.SheetView newSheet = null;
- if (sheet != null)
- {
- newSheet = FarPoint.Win.Serializer.LoadObjectXml(typeof(SheetView),FarPoint.Win.Serializer.GetObjectXml(sheet, "CopySheet"), "CopySheet") as SheetView;
- newSheet.SheetName = "NewSheet";
- }
- return newSheet;
- }
- }
复制代码 |