This question is locked. New answers and comments are not allowed.
When i update the produce,the GridView CellEditTemplate doesnot work
I want the Column of Score can be edited while the property of IsReadOnly of the gridview is set "true"
Before Update:
The Document says it has IsReadOnlyBinding property
so the new code i change as belows
Could you tell me how to set one column of the gridview editable while the gridview's isreadonly is true
I want the Column of Score can be edited while the property of IsReadOnly of the gridview is set "true"
Before Update:
<telerik:RadGridView IsReadOnly="true" AutoGenerateColumns="false"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/> <telerik:GridViewDataColumn Header="Score" DataMemberBinding="{Binding Score}"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Score}" /> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <TextBox Text="{Binding Score, Mode=TwoWay}" Loaded="Editor_Loaded" /> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView> public class Result: INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public Result() { } /// <summary> /// /// </summary> private string _Name ; [DataMember] public bool Name { get { return _Name ; } set { _Name = value; NotifyPropertyChanged("Name "); } } /// <summary> /// /// </summary> private decimal? _Score; [DataMember] public string Score { get { return _Score; } set { _Score= value; NotifyPropertyChanged("Score"); } }
} }The Document says it has IsReadOnlyBinding property
so the new code i change as belows
<telerik:GridViewDataColumn Header="Score" DataMemberBinding="{Binding Score}" IsReadOnlyBinding="{Binding CellIsReadOnly }"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Score}" /> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <TextBox Text="{Binding Score, Mode=TwoWay}" Loaded="Editor_Loaded" /> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> public class Result { public bool CellIsReadOnly = false; }Could you tell me how to set one column of the gridview editable while the gridview's isreadonly is true