Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF GridView SetReadOnly或基于复选框对列启用_C#_Wpf_Xaml_Mvvm - Fatal编程技术网

C# WPF GridView SetReadOnly或基于复选框对列启用

C# WPF GridView SetReadOnly或基于复选框对列启用,c#,wpf,xaml,mvvm,C#,Wpf,Xaml,Mvvm,我有一个RadGridView(telerik版本的GridView),在这个RadGridView中我有以下列: <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding Revoked}" AutoSelectOnEdit="True" Header="Revoked" UniqueName="Revoked" Width="Auto" IsReadOnly="False" FooterTextAlignment="Righ

我有一个
RadGridView
(telerik版本的
GridView
),在这个
RadGridView
中我有以下列:

<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding Revoked}" AutoSelectOnEdit="True" Header="Revoked" UniqueName="Revoked" Width="Auto" IsReadOnly="False" FooterTextAlignment="Right" CellStyle="{StaticResource GridCellStyle}" />
NotificationAgreement类具有以下属性

/// <summary>
/// Gets or sets a value indicating whether revoked.
/// </summary>
public bool Revoked
{
    get
    {
        return this.revoked;
    }

    set
    {
        this.revoked = value;
        this.RaisePropertyChanged(() => this.Revoked);
    }
}
//
///获取或设置一个值,该值指示是否已吊销。
/// 
公共图书馆被撤销
{
得到
{
退回此文件。已撤销;
}
设置
{
这个值=值;
this.RaisePropertyChanged(()=>this.reversed);
}
}

您可以粘贴您的ViewModel吗?我只想知道,当吊销被更改时,您正在向view发出通知

(1) 您的viewmodel应该有一个
ObservableCollection

(2)
yourObject
应该实现
INotifyPropertyChanged

(3) 您的对象应该具有以下属性

private bool _revoked;

public bool Revoked 
{
   get{return _revoked;}
   set { _revoked=value;
         RaisPropertyChanged("Revoked");
}

这只是模拟代码,请按照您的方式执行。

根据要求更新了我的问题
/// <summary>
/// Gets or sets a value indicating whether revoked.
/// </summary>
public bool Revoked
{
    get
    {
        return this.revoked;
    }

    set
    {
        this.revoked = value;
        this.RaisePropertyChanged(() => this.Revoked);
    }
}
private bool _revoked;

public bool Revoked 
{
   get{return _revoked;}
   set { _revoked=value;
         RaisPropertyChanged("Revoked");
}