禁止某列编辑的方法
如题,我想禁止表格中某一列的编辑功能,这个怎么做?您好使用保护单元格
gcSpreadSheet1.ActiveSheet.DefaultStyle.Locked = false;
gcSpreadSheet1.ActiveSheet.Cells.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;
}
}
页:
[1]