回复 2楼hyqangel的帖子
hyqangel 你好,
锁定单元格首先需要锁定 Spread 和 Sheet,再指定“可以”编辑的行、列、或单元格:
- gcSpreadSheet1.Protect = true;
- gcSpreadSheet1.Sheets[0].Protect = true;
- //单元格
- gcSpreadSheet1.Sheets[0].Cells[1, 1].Locked = false;
- gcSpreadSheet1.Sheets[0].Cells[1, 1].Text = "Locked";
- //列
- gcSpreadSheet1.Sheets[0].Columns[3].Locked = false;
- //行
- gcSpreadSheet1.Sheets[0].Rows[5].Locked = false;
复制代码 |