[英]How to set disable cell on cell level instead of whole column
根據列級解決方案: 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
的值?
如果禁用,則表示不允許用戶編輯單元格,那么我認為您需要ReadOnly屬性。
e.Cell.Row.Cells["someColumn"].ReadOnly = false;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.