我想从gridview“ ReadOnly”中整行

时间:2019-01-23 09:44:19

标签: c# devexpress

我正在使用Gridview,到目前为止,一切都很好!我的问题是,如果特定条件为假,如何将当前行设为只读?我已经测试并尝试了一些示例,但是没有运气。 我找到了一种方法使该列为只读,但是即时通讯无法使整个行变为只读。 提前致谢, 欧凡

1 个答案:

答案 0 :(得分:2)

使用事件ShowingEditor

private void  myGridView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e) {
    var gv = sender as GridView; 
    if (/* your condition to determine if the row is readokly */ ) {
        e.Cancel = true;
    }
}