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
![](/forums/images/avatarimages/default.gif)
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
![](/forums/images/avatarimages/default.gif)
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
![](/forums/images/avatarimages/default.gif)
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.
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
![](/forums/images/avatarimages/default.gif)
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?
![](/forums/images/avatarimages/default.gif)
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