【问题标题】:Disable Row in TelerikGrid in XAML Using MVVM使用 MVVM 在 XAML 中禁用 TelerikGrid 中的行
【发布时间】:2015-03-03 10:49:41
【问题描述】:

我正在使用WPF 应用程序,在该应用程序中我使用的是telerik gird,并且我正在使用MVVM 模型来绑定网格中的数据。我想根据集合中绑定到网格的值禁用或灰显行。它是一个布尔值。

是否有类似为下面代码中的列设置属性IsReadOnlyBinding

<telerik:GridViewDataColumn Width="40" IsFilterable="False"  HeaderTextAlignment="Center" Header="Max" DataMemberBinding="{Binding Constraint.MaxCountConstraint, Mode=TwoWay}" IsReadOnlyBinding="{Binding MyBoolValue}" Tag="Exclude" />

我怎样才能对行做同样的事情?

格子代码是,

<telerik:RadGridView x:Name="grdSetup" MinHeight="100" telerik:StyleManager.Theme="Windows8" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding MCCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" >

【问题讨论】:

    标签: c# wpf xaml mvvm telerik


    【解决方案1】:

    当您设置 RadGridView 的 IsReadOnlyBinding 属性时 - 当基础属性为 True 时,整行变为只读。

    <telerik:RadGridView x:Name="radGridView" IsReadOnlyBinding="{Binding IsActive}" />
    

    【讨论】:

      猜你喜欢
      • 2012-04-18
      • 1970-01-01
      • 2012-02-19
      • 1970-01-01
      • 1970-01-01
      • 2017-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多