【问题标题】:DataGridViewButtonColumn enabling buttons binding boolean fieldDataGridViewButtonColumn 启用按钮绑定布尔字段
【发布时间】:2012-03-05 17:42:37
【问题描述】:

我有一个自定义对象(比如MyObject),它有一个名为IsEnabled 的布尔属性。我将MyObject 的集合绑定到DataGridView,为每一列设置DataPropertyName

我想通过IsEnabled 属性的值启用DataGridViewButtonColumn 中的按钮。如何在不实现自定义列的情况下获得它?有可能吗?

将字段绑定到它不起作用的列...

【问题讨论】:

    标签: c# .net winforms datagridview


    【解决方案1】:

    似乎DataGridViewButtonColumn 中的按钮无法禁用,因此,按照这篇文章,获得我想要的唯一方法是实现自定义 DataGrid 列类型: http://msdn.microsoft.com/en-us/library/ms171619.aspx

    不太实用……

    【讨论】:

      猜你喜欢
      • 2018-01-17
      • 2011-02-16
      • 2022-08-14
      • 2013-05-11
      • 2018-01-29
      • 1970-01-01
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多