处理Lock状态的单元格是不允许用户编辑的,所以粘贴时单元格的值不会发生变化
可以考虑在粘贴时将Lock状态解除,粘贴完成后再次Lock:
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].Columns[1].Locked = true;
- fpSpread1.Sheets[0].Columns[3].Locked = true;
- }
- private void fpSpread1_ClipboardPasting(object sender, FarPoint.Win.Spread.ClipboardPastingEventArgs e)
- {
- fpSpread1.ActiveSheet.Columns[1].Locked = false;
- fpSpread1.ActiveSheet.Columns[3].Locked = false;
-
- }
- private void fpSpread1_ClipboardPasted(object sender, FarPoint.Win.Spread.ClipboardPastedEventArgs e)
- {
- fpSpread1.ActiveSheet.Columns[1].Locked = true;
- fpSpread1.ActiveSheet.Columns[3].Locked = true;
- }
复制代码 |