您好使用保护单元格
- gcSpreadSheet1.ActiveSheet.DefaultStyle.Locked = false;
- gcSpreadSheet1.ActiveSheet.Cells[0, 1, 10, 1].Locked = true;
- gcSpreadSheet1.ActiveSheet.Protect = true;
复制代码
或者在EditStarting事件中取消编辑
gcSpreadSheet1.EditStarting += GcSpreadSheet1_EditStarting;
- private void GcSpreadSheet1_EditStarting(object sender, GrapeCity.Windows.SpreadSheet.UI.EditCellStartingEventArgs e)
- {
- if (e.Column == 1)
- {
- e.Cancel = true;
- }
- }
复制代码 |