I hope this change doesn't go live without the option to turn if off.
15 Answers, 1 is accepted
Could you provide me with some more information how to reproduce your issues with IsReadOnlyBinding property?
Regards,Nedyalko Nikolov
the Telerik team
I have not tested this against varying grid settings, but this is the behavior we are seeing in our application. I rolled back to the previous version and all is well. Please don't let this change go live. We use this extensively and besides the headache and overhead of having to constantly raise property changed on every single column and row, the initial load suffers from it trying to collect all this info that it doesn't need except when a cell is going into edit mode...which may never happen.
Indeed IsReadOnlyBinding is cached on a column level and its value is calculated on demand (when cell is about to enter into edit mode), so it will not cause a performance penalty. I'm attaching a sample application for a reference. Please examine output there is a message when IsActive property is got. Am I doing something wrong?
P.S. When row enters into edit there is another hit to this getter, which is used to store original value which will be used if row editing is cancelled.
Nedyalko Nikolov
the Telerik team
Every single one of my columns that has a CellEditTemplate fails to fire the IsReadOnlyBinding. For example. But it doesn't matter whats in the template.
<
telerik:GridViewDataColumn
Header
=
"Type"
Width
=
"60"
DataMemberBinding
=
"{Binding MyDealType}"
IsReadOnlyBinding
=
"{Binding EntityDealType.IsReadOnly}"
SortMemberPath
=
"MyDealType"
UniqueName
=
"DealType"
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
telerikInput:RadComboBox
HorizontalAlignment
=
"Stretch"
ItemsSource
=
"{Binding DealTypeList}"
SelectedValue
=
"{Binding MyDealType, Mode=TwoWay}"
IsReadOnly
=
"True"
IsEditable
=
"True"
SelectedValuePath
=
"Key"
DisplayMemberPath
=
"Value"
GotFocus
=
"RadComboBox_GotFocus"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
Indeed if any column has CellEditTemplate or CellEditTemplateSelector any cell that belongs to such column will enter into edit mode (IsReadOnly or IsReadOnlyBinding properties are not taken into account in this case).
I think this is an expected behavior.
Nedyalko Nikolov
the Telerik team
I would actually expect the opposite because the intent of using the IsReadOnlyBinding property is to sometimes have the cell editable and sometimes not, it shouldn't matter if the CellEditTemplate is present or not. I want the CellEditTemplate to be applicable when IsReadOnlyBinding says that the cell is editable. I don't think that the presence of the CellEditTemplate should be used to decide if the user wanted to make the cell read-only or not.
As a side note, out of curiosity, can you also explain why the property IsReadOnlyBinding was introduced instead of making the new binding feature part of the existing IsReadOnly property?
Why couldn't we just have: IsReadOnly="{Binding Path=IsMyColumnReadOnly}" ?
Best regards,
Wiktor
Despite that, this behavior CHANGED WITH THE LATEST RELEASE without mention in release notes. This is an unannounced breaking change. My application is broken now. Are you saying I have to put my custom readonly binding back in now so quickly after I was able to remove it because someone randomly determined that cells with a custom templates don't deserve the same rights (rules) as default cells?
The only mention in the release notes was that the feature was added - there was no mention of it being broken. I did give a heads up before it went live.
The IsReadOnly is purely for the column, not the cell. I do not use this property so I am not familiar with if it supports binding.
IsReadOnlyBInding is for cell (a column per row) based setting. It is not actually a DependencyObject itself that responds to binding I expect it only holds the binding to evaluate later - at least this is how I implemented it. The two properties perform two seperate and different functions and could not serve double duty.
Column.IsReadOnly will cause every cell in that column to be effected the same and the datacontext of a column is that of the grid, so if this property supports binding it will NOT be at the row context
.
Column.IsReadOnlyBinding will allow each cell to evaluate the value of the binding based on the row's context - but of course only when attempting to go into edit mode. Unless, of course, you have a CellEditTemplate - then you are on your own :)
Nedyalko Nikolo wrote:
"Indeed if any column has CellEditTemplate or CellEditTemplateSelector any cell that belongs to such column will enter into edit mode (IsReadOnly or IsReadOnlyBinding properties are not taken into account in this case).
I think this is an expected behavior."
I disagree with that. For me, the 2010 Q3 have a bug.
The correct behaviour must be: If IsReadOnlyBinding is true then the RadGridView must force to use the CellTemplate.
Yvan
The reported behavior is not a bug since the logic behind is created in such a way that the editing is allowed if a CellEditTemplate is defined. However, we do make some additional considerations on the topic and we reach to the conclusion that it is more expected to be the other way around - once the read-only properties are set to true, editing is not allow. Consequently, we are in the process of changing the behavior so that it meets your requirements.
Thank you for feedback.
Maya
the Telerik team
Please can we have an update to the status of this issue and whether there is a workaround?
We have already changed the behavior when IsReadOnly/ IsReadOnlyBinding are "True" and a CellEditTemplate is defined. You may test it our Latest Internal Build binaries. Still I am sending you a sample project illustrating the behavior.
Maya
the Telerik team