简体   繁体   English

禁用/取消选中GridView(DevExpress)中的复选框

[英]Disable / uncheck checkbox in GridView (DevExpress)

Is there any way to programmatically uncheck or disable row's checkbox (just for a few, based on condition) in DevExpress.XtraGrid.Views.Grid.GridView? 有什么方法可以在DevExpress.XtraGrid.Views.Grid.GridView中以编程方式取消选中或禁用行的复选框(仅根据情况禁用几个复选框)? GridView is binded with BindingSource. GridView与BindingSource绑定。 If you need any other informations, just ask. 如果您需要任何其他信息,请询问。 I recieve a project with DevExpress but no experience with it so sorry if my question is silly. 我收到了一个使用DevExpress的项目,但是没有任何经验,如果我的问题很傻,对不起。 Thank you for your help. 谢谢您的帮助。

This is a solution I've found. 这是我找到的解决方案。

private void GridView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
{
    if (<some condition>)
        e.Cancel = true;

}

More info here. 更多信息在这里。

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

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