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

IsExpandableBinding requires user interaction with control to take effect

9 Answers 155 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 15 Jun 2015, 04:49 PM

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.

9 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 17 Jun 2015, 02:56 PM
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.
0
Stefan
Telerik team
answered on 17 Jun 2015, 02:57 PM
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
0
Scott
Top achievements
Rank 1
answered on 14 Jul 2016, 04:25 PM
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.
0
Stefan
Telerik team
answered on 19 Jul 2016, 08:10 AM
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.
0
Scott
Top achievements
Rank 1
answered on 02 Aug 2016, 12:58 PM

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. 

0
Stefan
Telerik team
answered on 04 Aug 2016, 02:29 PM
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.
0
Emil
Top achievements
Rank 1
answered on 17 Nov 2017, 04:50 PM

Hey,

I am experiencing similar issue with RadTreeListView. I have this binding IsExpandableBinding="{Binding HasItems, Mode=TwoWay}"

This works most of the time. Something however expanded button is not showing. I am using fiddler and I can see that HasItems = true for the row that is missing expand button but RadGridViewRow.IsExpandableBinding is false. This happen rarely and I noticed that before update of HasItems I am updating other properties of the viewmodel. So may be it is somehow related to the order of OnPropertyChanged? If i disable other property updates before HasItems it seems to work without issues.

 

Currently as a workaround I am binding directly to RadGridViewRow.IsExpandable property like that

 

          <telerik:RadTreeListView.RowStyle>
                <Style TargetType="telerik:TreeListViewRow" BasedOn="{StaticResource TreeListViewRowStyle}">
                    <Setter Property="IsExpandable" Value="{Binding Path=HasItems, Mode=TwoWay}" />
                </Style>
            </telerik:RadTreeListView.RowStyle>

I know this is not how documentation suggest to use IsExpandable of RadTreeListView but that bug is a showstopper for us. I need to know if you are aware of this bug and has it been fixed in newer versions?

Also, if you can tell me if the workaround above safe to use?

0
Emil
Top achievements
Rank 1
answered on 17 Nov 2017, 04:52 PM
I meant Snoop not fiddler. Sorry
0
Stefan
Telerik team
answered on 22 Nov 2017, 01:14 PM
Hello Emil,

For the time being, we are not aware of such behavior. Based on your description, it indeed seems to be a timing issue, but I cannot confirm this with certainty. In order to avoid any misunderstandings and shorten the time for pinpointing the cause of the problem, may I kindly ask you to open a new support thread and demonstrate the problem in a simplified application as an attachment? Would this be possible for you?

Thank you in advance for your cooperation.

All the best,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeListView
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Stefan
Telerik team
Scott
Top achievements
Rank 1
Emil
Top achievements
Rank 1
Share this question
or