2017-03-06 62 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'標籤可用 –