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

16 posts, 0 answers
  1. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 26 Oct 2010 Link to this post

    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.
  2. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 29 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 29 Oct 2010 Link to this post

    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.
  5. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 29 Oct 2010 Link to this post

    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
  6. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 29 Oct 2010 Link to this post

    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.
  7. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 11 Nov 2010 Link to this post

    Q3 has broken this behavior for our application. We made no changes, just installed the Q3 and it is broken.
  8. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 11 Nov 2010 Link to this post

    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>
  9. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 14 Nov 2010 Link to this post

    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
  10. Wiktor
    Wiktor avatar
    11 posts
    Member since:
    Sep 2010

    Posted 14 Nov 2010 Link to this post

    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
  11. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 15 Nov 2010 Link to this post

    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.
  12. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 15 Nov 2010 Link to this post

    @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 :)
  13. Yvan
    Yvan avatar
    16 posts
    Member since:
    Sep 2007

    Posted 20 Nov 2010 Link to this post

    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
  14. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 30 Nov 2010 Link to this post

    Is this issue slipping to the wayside? This is a major issue for me.
  15. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 01 Dec 2010 Link to this post

    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
  16. IsolatedStorage
    IsolatedStorage avatar
    15 posts
    Member since:
    Sep 2009

    Posted 22 Dec 2010 Link to this post

    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?
  17. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Dec 2010 Link to this post

    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
Back to Top
DevCraft banner