根据列级别的解决方案: https://stackoverflow.com/a/11803015/1460189
private void dg_CellListSelect(object sender, CellEventArgs e)
{
if (e.Cell.Column.Key == "someID")
e.Cell.Row.Cells["someColumn"].Activation = Activation.NoEdit;
//Property or indexer cannot be assigned to -- it is read only
}
根据特定单元格的某些逻辑,我想禁用它,但显然无法设置属性Activation
的值?
答案 0 :(得分:0)
如果禁用,则表示用户不允许编辑单元格,那么我认为您需要ReadOnly属性。
e.Cell.Row.Cells["someColumn"].ReadOnly = false;