IsExpandableBinding requires user interaction with control to take effect

7 posts, 0 answers
  1. David
    David avatar
    27 posts
    Member since:
    Apr 2013

    Posted 15 Jun 2015 Link to this post

    Hi,

     

    I have a RadTreeListView that is using IsExpandableBinding.  I need to prevent certain items from being expandable based on configurations else where in the application.  I am binding IsExpandableBinding to a property that has an OnPropertyChanged call.  It is working except that I need to click somewhere on the TreeListView for the change to occur.  The same property is used to trigger changes to the font of the item's textbox in the TreeListView and that works fine.  As soon as the property changes to false, the text color changes to gray and the text is italicized, but the expansion icon is still present.  As soon as I click somewhere on the TreeListView, the expansion icon disappears.  Why does the TreeListView require user interaction to be updated with the binding change?  How can I fix this?

     

    This is the first line of the TreeListView:

     <telerik:RadTreeListView x:Name="TreeView" SelectionUnit="FullRow" AutoGenerateColumns="False" DataLoadMode="Synchronous" EnableRowVirtualization="False" EnableColumnVirtualization="False"  IsExpandableBinding="{Binding IsExpandable}">

     

    This is the IsExpandable property:

    public virtual bool IsExpandable
        {
          get
          {
            return _isExpandable && !(_node is LeafNode);
          }
          set
          {
            if (_isExpandable != value)
            {
              _isExpandable = value;

              OnPropertyChanged("IsExpandable");
            }
          }
        }

     

    Thanks.

  2. David
    David avatar
    27 posts
    Member since:
    Apr 2013

    Posted 17 Jun 2015 in reply to David Link to this post

    Ok, I think you can ignore this one.  I have it mostly working.  The IsExpandable is working but it is very sensitive to the order in which OnPropertyChanged calls are made.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 17 Jun 2015 Link to this post

    Hello David,

    Such behavior is not reproducible on my side. Can you please review the sample project I have attached, modify it as per your exact project setup and send it to us in a new support ticket? By doing so we will be able to debug it and guide you accordingly.

    Best Regards,
    Stefan X1
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Scott
    Scott avatar
    15 posts
    Member since:
    Oct 2014

    Posted 14 Jul Link to this post

    Out of curiosity what were the changes to the OnPropertyChanged calls that you had to make to get it to work? I am seeing similar behavior.
  6. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 19 Jul Link to this post

    Hello Scott,

    There is nothing project specific in the implementation of the INotifyPropertyChanged interface, so that the IsExpandedBinding mechanism is forced to work. As mentioned in my previous reply, may I ask you to modify the sample application in a way that reproduces the issue and send it as an attachment in a new support thread? We will be happy to help.

    Thanks in advance for your cooperation.

    Regards,
    Stefan X1
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  7. Scott
    Scott avatar
    15 posts
    Member since:
    Oct 2014

    Posted 02 Aug in reply to Stefan X1 Link to this post

    Sorry for taking a while to respond. I had to take care of some other tasks first.

    Per your request, I have created a bug report found here that includes a modified version of the IsExpandedRowBinding example that can reproduce the problem I am seeing. 

  8. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 04 Aug Link to this post

    Hi Scott,

    Thank you for the feedback.

    I have responded you in the referred item in the Feedback Portal. I will, however paste my reply here as well.

    Indeed, this seems to be an issue on our end. It is reproduced due to the virtualization mechanism of the control. When a given row gets out of the viewport, it is being unloaded. Thus, it cannot be collapsed/expanded. Respectively, when it gets back in the viewport it is being reloaded and its IsExpandedBinding is evaluated. We will research the possibility for handling this scenario. Please note, however, that since the virtualization mechanism is involved, we cannot commit ourselves that a stable fix for this issue can be implemented.

    I have also updated your Telerik points as a gratitude for your cooperation.

    All the best,
    Stefan X1
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready