2017-03-06 49 views
1

根据在列级别的解决方案: 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

您使用哪个版本的Infragistics? –

+0

您的意思是“我无法设置激活值”?你有错误吗?或者你有一些例外? – wnvko

回答

0

如果通过禁用您的意思是不允许用户编辑单元格,那么我认为您需要ReadOnly属性。

e.Cell.Row.Cells["someColumn"].ReadOnly = false; 
+0

没有'ReadOnly'标签可用 –