如何使网格列单元格只能在Dev-Express中读取?

时间:2016-07-05 08:03:53

标签: devexpress devexpress-wpf

我需要将Grid Cell设为只读如果我的条件是假的。在devexpress gridControl中。

1 个答案:

答案 0 :(得分:1)

尝试此操作并根据要求更改条件

protected void ASPxGridView1_CellEditorInitialize(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditorEventArgs e) {
    if (ASPxGridView1.IsNewRowEditing) return;
    if (e.Column.FieldName == "UnitPrice")
             if (ASPxGridView1.GetRowValues(....) == ....)
                   e.Editor.ReadOnly = true;
}