Call stack:
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeViewItem.IsExpanded.set(bool value) Line 390 C#
> Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeViewItem.OnIsExpandedChanged(bool oldValue, bool newValue) Line 1186 C#
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeView.RestoreContainerProperties(object item, Telerik.Windows.Controls.RadTreeViewItem treeViewItem) Line 678 C#
10 Answers, 1 is accepted
I tried to reproduce the reported behavior on our side with our latest official release and it seems that the code works as expected. Could you please take a look at the attached project and let us know if there is something that I missed? It will be great if you can change the code so that the issue can be reproduced on our side and send it over. By doing this we will be able to further investigate the possible reasons behind.
Regards,
Pavel R. Pavlov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Hi Brian,
I have the same problem.
The Binding continues until I manually expand or collapse the node.
At that moment, the Binding is stopped.
The problem also exists in the example you sent.
I demonstrated the problem in the video. See attached link.
https://www.dropbox.com/s/4gyh9f63399gbem/ScreenCapture_26-11-2017%2011.21.50.wmv?dl=0
Shilo
The last comment I wrote was for you (not for Brian)
Shilo
To update the property of the model (DataItem) when you expand/collapse a node manually you can set the Mode of the binding to TwoWay.
<
Style
TargetType
=
"telerik:RadTreeViewItem"
x:Key
=
"MyStyle"
>
<
Setter
Property
=
"IsExpanded"
Value
=
"{Binding IsExpanded, Mode=TwoWay}"
/>
</
Style
>
Regards,
Martin Ivanov
Progress Telerik
I have the same problem. I have the IsExpanded Binding bound two way, the bound property value in the node view model is initialized to true, before the item becomes visible. Then this value is set to false with the following call stack. Please advice how to stop that. Otherwise I cannot define a preexpanded tree.
> Ade.Hierarchies.dll!Ade.Hierarchies.DefaultHierarchyTreeVisualStateProvider.SetIsExpanded(System.Guid nodeId, bool isExpanded) Line 52 C#
Ade.Hierarchies.UIImpl.dll!Ade.Hierarchies.UI.HierarchyTreeNodeViewModel.IsExpanded.set(bool value) Line 283 C#
[Native to Managed Transition]
[Managed to Native Transition]
PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.SetValue(object item, object value) Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpression.UpdateSource(object value) Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.UpdateValue() Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.ProcessDirty() Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.Dirty() Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.SetValue(System.Windows.DependencyObject d, System.Windows.DependencyProperty dp, object value) Unknown
WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) Unknown
WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeViewItem.OnIsExpandedChanged(bool oldValue, bool newValue) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeView.RestoreContainerProperties(object item, Telerik.Windows.Controls.RadTreeViewItem treeViewItem) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeView.PrepareContainerForDescendant(System.Windows.DependencyObject element, object item, System.Windows.Controls.ItemsControl owner) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeView.PrepareContainerForItemOverride(System.Windows.DependencyObject element, object item) Unknown
PresentationFramework.dll!System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(System.Windows.DependencyObject container, object item) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TreeView.TreeViewPanel.InsertContainer(int childIndex, System.Windows.UIElement container, bool isRecycled) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TreeView.TreeViewPanel.AddContainerFromGenerator(int childIndex, System.Windows.UIElement child, bool newlyRealized) Unknown
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TreeView.TreeViewPanel.MeasureOverride(System.Windows.Size constraint) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Unknown
Hello Arthur,
I've tested the reported behavior with the latest version of Telerik UI for WPF, but I wasn't able to reproduce the issue on my side. Can you check the attached project and let me know if I am missing anything?
Regards,
Martin Ivanov
Progress Telerik
Hello Martin,
I have opened a ticket and discussed the issue there. The problem occures, when the virtualization is turned on. Please see ticket 1451753 and the steps to reproduce. I hope that this issue reaches the developers as this is completely unexpected, that the virtualization changes the state of the view models.
Regards,
Arthur
For anybody having the same issue, you can vote for it here:
https://feedback.telerik.com/wpf/1452191-treeview-add-an-option-to-prevent-setting-the-isexpanded-property-of-a-radtreeviewitem-that-has-no-children-to-false
Hello Arthur,
Thank you for sharing the feedback item.
Regards,
Martin Ivanov
Progress Telerik