In the documentation it shows setting the VirtualizatonMode of the TreeViewPanel with an attached property:
<telerik:RadTreeView x:Name="radTreeView" telerikTreeView:TreeViewPanel.IsVirtualizing="True" telerikTreeView:TreeViewPanel.VirtualizationMode="Hierarchical">
However VS is giving me the error that the attached property is read only.
Has this method changed, or am I maybe doing something else incorrectly?
Thanks,
Andrew
11 Answers, 1 is accepted
We have checked our code and the attached TreeViewPanel.VirtualizationMode Property is not readonly. As we were unable to reproduce the issue at our side I would like to ask you for more details:
- what is the version of VisualStudio you are using ?
- are you with our latest dll's, if not what is their version?
Is it possible for you to send us an isolated project reproducing the issue? This way we would be better able to investigate it.
Thank you for your cooperation in advance.
Kind regards,
Kiril Vandov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I have the same problem. It works well under VS 2010 and .NET 4.0. But as soon as I use those attached propertys under VS 2012 and .NET 4.5, I get this error:
error MC1000: Unknown build error, 'Ambiguous match found. Line 580 Position 49.'
telerikTreeView:TreeViewPanel.IsVirtualizing="True"
telerikTreeView:TreeViewPanel.VirtualizationMode="Hierarchical"
As soon as I remove the second line, VS 2012 will build without any error!
The exactly same code is build under VS 2010.
Regards
Felix
It seems that we have a bug with the VirtualizationMode property of the RadTreeView in WPF 4.5. We created a PITS item for it, where you can vote and track the progress of the task.
Please accept our apology for the inconvenience.
Regards,
Kiril Vandov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thanks,
Andrew
Unfortunately we can't schedule the fix for this task at the moment. However as a workaround you could set the VirtualizationMode property from code behind.
I hope this isn't a show-stopper for you.
Kind regards,
Kiril Vandov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
yes, this workaround works (code behind). Thank you for this hint.
I have inserted this line in the constructor of the Window/UserControl after the InitializeComponent() call.
Regards
Felix
// Just a workaround for WPF 4.5 (build error when setting this in XAML)
TreeView.SetValue( TreeViewPanel.VirtualizationModeProperty, VirtualizationMode.Hierarchical );
Hi,
The link to the PITS item is no longer valid. Still having this problem 3 years later...
Thanks,
Louis
This error is caused by the fact that the TreeViewPanel inherits from the MS VirtualizingPanel which in .Net4.5 exposes that same property and we are hiding an inheritance property. As Microsoft reports that the XAML parser is designed to work in that way, we have introduced another attached property which is doing the same thing. We suggest you to use the new telerik:TreeViewPanel.TreeVirtualizationMode property which works and build as expected.
I hope this information helps.
Kind regards,
Kiril Vandov
Telerik
Hello Kiril,
I have the problem, that using
<Setter Property="telerik:TreeViewPanel.TreeVirtualizationMode"
Value="Recycling"/>
in our RadTreeView's style causes an error, saying that an ArgumentNullException occured and that the property value is not allowed to be NULL. If I set the mode directly at the tree instance instead of inside the style, there is no problem. Any ideas, what could be the issue?
Arthur
Hello Arthur,
The attached TreeViewPanel.TreeVirtualizationMode property can't be set via Style. It needs to be set directly to the RadTreeView control. That is why en exception is raised.
Regards,
Dinko
Progress Telerik