【问题标题】:How to Enable , Disable checkbox column in Silverlight Datagrid based on my Data如何根据我的数据启用、禁用 Silverlight Datagrid 中的复选框列
【发布时间】:2012-07-21 15:37:37
【问题描述】:

我有一个 silverlight 数据网格,其中第一列是复选框列。

看起来像这样..

 <sdk:DataGridCheckBoxColumn Header ="Select" Binding="{Binding Path=IsChecked ,Mode=TwoWay}" ></sdk:DataGridCheckBoxColumn>

这将根据我的绑定属性 IsChecked 进行检查或取消检查。

我还有一个绑定属性 IsCheckBoxEnabled。

是否可以使用此属性启用禁用复选框。

类似的东西。

<sdk:DataGridCheckBoxColumn Header ="Select" IsReadOnly={Binding IsCheckBoxEnabled} Binding="{Binding Path=IsChecked ,Mode=TwoWay}" ></sdk:DataGridCheckBoxColumn>

虽然上面的行不起作用。我错过了什么吗?我不想在后面的代码中处理它。

【问题讨论】:

    标签: silverlight datagrid checkbox


    【解决方案1】:

    我遇到了同样的问题:

    Silverlight, datagrid, autogenerated columns on modified column change cell visibility of content

    这就是我找到并修复它的方式。

    【讨论】:

    • 不,它是同一件事..在你建议的链接中..它仍然绑定在一个属性上..我有两个属性..:(
    • 我已经有了 - 示例在链接上。将转换为而不是说 if this then visible else it not.. 改为 if that and this then checks else not..
    猜你喜欢
    • 2016-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 2023-02-03
    相关资源
    最近更新 更多