一方面,添加行之后可以通过复制的方式将之前的样式粘贴过来;另一方面,可以通过代码对新增加行的样式进行设置。
- private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].RowCount += 3;
- fpSpread1.Sheets[0].AddSpanCell(fpSpread1.Sheets[0].RowCount-3, 0, 3, 1);
- fpSpread1.Sheets[0].ClipboardCopy(new FarPoint.Win.Spread.Model.CellRange(fpSpread1.Sheets[0].RowCount-6,0,3,8));
- fpSpread1.Sheets[0].ActiveRowIndex = fpSpread1.Sheets[0].RowCount -3;
- fpSpread1.Sheets[0].ActiveColumnIndex = 0;
- fpSpread1.Sheets[0].ClipboardPaste(FarPoint.Win.Spread.ClipboardPasteOptions.Formatting);
- }
复制代码 |