繁体   English   中英

我想从gridview“ ReadOnly”中整行

[英]I want to make a entire row from a gridview “ReadOnly”

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

使用事件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;
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM