回复 1楼yaoxiaoqiang00的帖子
可以提供给您一个思路就是在ClipBoardPasted事件中来清除不可编辑单元格文本达到目标效果:
- /// <summary>
- /// 检测粘贴单元格文本,如果含有非数字则清空单元格
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void gcSpreadSheet1_ClipboardPasted(object sender, GrapeCity.Windows.SpreadSheet.UI.ClipboardPastedEventArgs e)
- {
- int rowCount = e.CellRange.RowCount;
- int colCount = e.CellRange.ColumnCount;
- int row = e.CellRange.Row;
- int col = e.CellRange.Column;
- for (int i = row; i < row+rowCount; i++)
- {
- for (int j = col; j < col+colCount; j++)
- {
- }
- }
- }
复制代码 |