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

RadTreeView inside RadPanelBarItem not virtualizing

3 Answers 88 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Brian Nguyen
Top achievements
Rank 1
Brian Nguyen asked on 25 May 2010, 12:43 AM
I have a RadPanelBar with one RadPanelBarItem that contains a RadTreeView with IsVirtualized="True". While the RadTreeView is inside the RadPanelBarItem, the virtualization is not working (it takes about 7 seconds to load 500 items). However, if I take the RadTreeView out of the RadPanelBar, virtualization works (it takes about 1 second to load 500 items).

I assume it is similar to putting a RadTreeView inside of a ScrollViewer because it's childen have infinite space and therefore disables virtualization. How can I overcome this issue?

Thanks in advance,

Ryan

3 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 25 May 2010, 11:59 AM
Hello Brian Nguyen,

Yes, you are correct. The PanelBar contains a ScrollViewer in its template and its panel acts as StackPanel (which does not limit the height of its children even if it exceeds its own height).

Is setting a (Max)Height on the TreeView an option for you? Alternatively you need to disable the vertical scrolling  in the PanelBar.

Regards,
Miroslav
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Brian Nguyen
Top achievements
Rank 1
answered on 25 May 2010, 05:35 PM
Thanks!

I was able to set the MaxHeight of my RadTreeView by binding it to the ActualHeight property of the parent UserControl.

MaxHeight="{Binding ElementName=UserControlName, Path=ActualHeight}"

* You must set the x:Name="UserControlName" on your UserControl for the above binding to work.
0
Karl
Top achievements
Rank 1
answered on 24 Feb 2011, 04:01 PM
Brian,

Thanks, this helped me out and is a very elegant solution.
Tags
TreeView
Asked by
Brian Nguyen
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Brian Nguyen
Top achievements
Rank 1
Karl
Top achievements
Rank 1
Share this question
or