【问题标题】:How can i make a grid column cell to read only in Dev-Express?如何使网格列单元格在 Dev-Express 中只读?
【发布时间】:2016-07-05 19:47:50
【问题描述】:

如果我的条件为假,我需要将网格单元格设为只读。在 devexpress gridControl 中。

【问题讨论】:

  • 注意:只有 Dev-express 知道要回答的人。

标签: devexpress devexpress-wpf


【解决方案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;
}

【讨论】:

  • 谢谢,我在 WPF private void tblView_ShowingEditor(object sender, ShowingEditorEventArgs e) { if (e.Row != null) { if (e.Column.FieldName = = "ColumnName") { e.Cancel = true; } } }
猜你喜欢
  • 2017-07-07
  • 2011-12-05
  • 1970-01-01
  • 2015-11-19
  • 2019-07-26
  • 2012-01-21
  • 2017-09-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多