This is a migrated thread and some comments may be shown as answers.

Please please don't change IsReadOnlyBinding as it is in latest internal build

15 Answers 255 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tyree
Top achievements
Rank 2
Tyree asked on 26 Oct 2010, 08:22 PM
It appears you are attempting to cache IsReadOnlyBinding results when the grid is populated (or scrolled). This behavior will not work for us at all, we need ours to test each time a cell attempts to enter edit mode. The latest internal build 10/22 is the first I have seen this change and it has broken our application. Obviously I can roll back, and have, but I wanted to express that this change is #1 not in the release notes! and #2 prevent us from upgrading. I can't think of any benefit to caching this binding result as it is only done per cell, whereas caching causes it to run for every cell and every row and slows the load of my grid - despite the fact that it broke the behavior.

I hope this change doesn't go live without the option to turn if off.

15 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 29 Oct 2010, 02:18 PM
Hello Tyree,

Could you provide me with some more information how to reproduce your issues with IsReadOnlyBinding property?

Regards,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tyree
Top achievements
Rank 2
answered on 29 Oct 2010, 02:30 PM
Using the 10/22 build, if you bind a column.IsReadOnlyBinding to a property, put a breakpoint on that property getter. It will fire as the rows are loaded into the grid. It will not fire when you click on a cell to put it into edit mode. Therefore, assuming the notification works for this binding, I would have to raise a change for every single column and row to make sure it had its proper value when something changes that effects the value of the readonly binding.

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.
0
Nedyalko Nikolov
Telerik team
answered on 29 Oct 2010, 03:31 PM
Hi Tyree,

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.

Sincerely yours,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tyree
Top achievements
Rank 2
answered on 29 Oct 2010, 04:25 PM
The sample does perform as expected. This is not the behavior I saw when I upgraded - none of our readonly code was getting called when a cell attempted to go into edit mode, it appeared to only get hit when the grid loaded. When I have time I will upgrade again and create a sample.
0
Tyree
Top achievements
Rank 2
answered on 11 Nov 2010, 04:07 PM
Q3 has broken this behavior for our application. We made no changes, just installed the Q3 and it is broken.
0
Tyree
Top achievements
Rank 2
answered on 11 Nov 2010, 04:39 PM

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>
0
Nedyalko Nikolov
Telerik team
answered on 14 Nov 2010, 03:01 PM
Hello Tyree,

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.

All the best,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Wiktor
Top achievements
Rank 1
answered on 15 Nov 2010, 02:22 AM
You said that it is an expected behavior that the IsReadOnlyBinding is not taken into account when the CellEditTemplate is present. Could you explain why?

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
0
Tyree
Top achievements
Rank 2
answered on 15 Nov 2010, 05:20 PM
I have to disagree, this is not the expected behavior. The CellEditTemplate is to define the look and use of the cell when you can put that cell into edit mode. The IsReadOnlyBinding is our mechanism to determine if it should go into edit mode.

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.
0
Tyree
Top achievements
Rank 2
answered on 16 Nov 2010, 05:19 AM
@Wiktor

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 :)
0
Yvan
Top achievements
Rank 1
answered on 21 Nov 2010, 03:55 AM

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
0
Tyree
Top achievements
Rank 2
answered on 30 Nov 2010, 02:58 PM
Is this issue slipping to the wayside? This is a major issue for me.
0
Maya
Telerik team
answered on 01 Dec 2010, 04:13 PM
Hi,

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.
 

Sincerely yours,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
IsolatedStorage
Top achievements
Rank 1
answered on 23 Dec 2010, 05:52 AM
This issue of IsReadOnlyBinding not working for CellEditTemplates is also causing me a problem.

Please can we have an update to the status of this issue and whether there is a workaround?
0
Maya
Telerik team
answered on 23 Dec 2010, 08:23 AM
Hello Tyree,

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.

Best wishes,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Tyree
Top achievements
Rank 2
Answers by
Nedyalko Nikolov
Telerik team
Tyree
Top achievements
Rank 2
Wiktor
Top achievements
Rank 1
Yvan
Top achievements
Rank 1
Maya
Telerik team
IsolatedStorage
Top achievements
Rank 1
Share this question
or