Spread中可以复制自定义的列头或者行头,默认的行头和列头(A/B/C/D...)不支持复制,复制自定义行头或者列头需要设置ClipboardOptions属性,而且在复制是需要选择整列/行才能复制列/行头:
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].RowCount = 5;
- fpSpread1.Sheets[0].ColumnCount = 5;
- fpSpread2.Sheets[0].RowCount = 5;
- fpSpread2.Sheets[0].ColumnCount = 5;
- fpSpread1.Sheets[0].Columns[0].Label = "AA";
- fpSpread1.Sheets[0].Columns[1].Label = "BB";
- fpSpread1.Sheets[0].Columns[2].Label = "CC";
- fpSpread1.Sheets[0].Columns[3].Label = "DD";
- fpSpread1.Sheets[0].Columns[4].Label = "EE";
- fpSpread1.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.AllHeaders;
- }
复制代码 |