【问题标题】:WPF: How to bind the IsEnabled property of a buttonWPF:如何绑定按钮的 IsEnabled 属性
【发布时间】:2010-11-19 11:05:01
【问题描述】:

如何使用 WPF 将 ButtonIsEnabled 属性绑定到网格的选定行的 DataGridCheckBoxColumn 值?

因此,每当我的网格中选定的行发生更改时,按钮将根据其中一列的值启用/禁用。

【问题讨论】:

    标签: c# .net wpf vb.net isenabled


    【解决方案1】:

    按钮看起来像这样

    <Button Content="Update" IsEnabled="{Binding ElementName=grid, Path=SelectedItem.SomeValue}"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-21
      • 1970-01-01
      • 2012-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-19
      • 2021-09-25
      相关资源
      最近更新 更多