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

TreeViewPanel.VirtualizationMode issue

11 Answers 161 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 12 Dec 2012, 10:37 PM
Hello,

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

Sort by
0
Kiril Vandov
Telerik team
answered on 17 Dec 2012, 12:10 PM
Hello Andrew,

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.

0
Felix
Top achievements
Rank 1
answered on 24 Jan 2013, 06:55 PM
Hi Kiril,

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

0
Kiril Vandov
Telerik team
answered on 29 Jan 2013, 04:31 PM
Hello 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.

0
Andrew
Top achievements
Rank 1
answered on 29 Jan 2013, 06:27 PM
Glad to hear that this issue is now understood. Since this is a bug, how likely is it that we'll get a proper fix in the short term?

Thanks, 

Andrew
0
Kiril Vandov
Telerik team
answered on 01 Feb 2013, 12:58 PM
Hi 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.

0
Felix
Top achievements
Rank 1
answered on 01 Feb 2013, 01:50 PM
Hi Kiril,

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 );
0
Louis
Top achievements
Rank 1
answered on 23 Jun 2016, 08:15 PM

Hi,

The link to the PITS item is no longer valid. Still having this problem 3 years later...

Thanks,

Louis

 

0
Kiril Vandov
Telerik team
answered on 28 Jun 2016, 09:04 AM
Hello 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
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Arthur
Top achievements
Rank 1
answered on 06 Dec 2019, 08:06 AM

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

0
Arthur
Top achievements
Rank 1
answered on 06 Dec 2019, 08:29 AM
In the meantime I observed, that Recycling is the default value for the VirtualizationMode property, so I can resolve this issue, by removing the setter. But for others, that do not want "Recycling" to be the default, this can still be a problem.
0
Dinko | Tech Support Engineer
Telerik team
answered on 11 Dec 2019, 08:01 AM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Felix
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Louis
Top achievements
Rank 1
Arthur
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or