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

RadTreeView with thousands of nodes is very slow, takes too long to expand/collapse

3 Answers 612 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Faye
Top achievements
Rank 1
Faye asked on 06 Jun 2011, 06:55 AM

Performance of RadTreeView with thousands of nodes is very slow, takes too long to expand/collapse:

~3000 nodes – expand: ~2 mins 32 secs, collapse: ~28 secs

~9000 nodes – expand: ~27 mins 26 secs, collapse: ~4 mins 57 secs

Note: For hundreds of nodes, performance is slightly better but still quite slow: ~100 nodes – ~1.5 secs. Scrolling is also badly delayed.

 

I am using a trial version of the RadControls for Silverlight 4, Windows XP, IE6. TreeView’s IsVirtualizing=true and VirtualizationMode=Hierarchical. Items in the TreeView use a simple HierarchicalDataTemplate which consists of an Ellipse, Image, TextBlock and TextBox. ItemsSource points to a class that generates dummy data using classes with typical properties (ex. string, bool, struct, DateTime).

 

The tree structure used for testing is 6 levels deep and there are thousands leaf nodes:

Level1

                Level2

                                Level3

                                                Level4

                                                                Level5

                                                                                <thousands of leaf nodes>

 

The TreeView is declared as follows:

<telerik:RadTreeView ItemsSource="{Binding Source={StaticResource DataSource},

                                                                       Path=TreeNodes}"

                                         ItemTemplate="{StaticResource TreeItemTemplate}"

                                         IsVirtualizing="True"

                                         telerik:TreeViewPanel.VirtualizationMode="Hierarchical"

                                         IsLoadOnDemandEnabled="True"

                                         SelectionMode="Extended"

                                         SelectionChanged="treeView_SelectionChanged"

                                         KeyDown="treeView_KeyDown"

                                         ScrollViewer.VerticalScrollBarVisibility="Visible"/>

 

Even tried turning off animation (telerik:AnimationManager.IsAnimationEnabled="False") as mentioned in some forums but this did not yield a better result.

 

I noticed though, that using RadTreeListView has no problems with ~3000 or ~9000 nodes:

~3000 nodes – expand: ~0.9 secs, collapse: ~0.3 secs

~9000 nodes – expand: ~1.2 secs, collapse: ~0.5 secs

Am I missing something when it comes to TreeView?

 

Any suggestions on how to improve the TreeView performance for a large number of nodes? This is too slow considering UI virtualization is already enabled and the data are merely objects, no interaction with any database or server.

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 08 Jun 2011, 12:10 PM
Hi Faye,

We are aware of the fact that the current version of RadTreeView needs performance optimization when ExpandAll Collapse all operations are used. We have logged this previously in our PITS(TreeView: Too many TreeViewItems are created internally when using virtualization) and you are able to vote for it in order to increase its development priority.
However, if you do need a large number of expand operations you could use RadTreeListView instead of RadTreeView. On the other hand, if you need to expand only particular nodes at a time , I think the RadTreeView could fit nicely in your scenario. You can examine this performance demo (showing generation of millions of items) and this blog post showing how to expand a particular node if you know its path from the tree`s root node.
Please let us know if you need more info on this. We would be glad to advice you.


Kind regards,
Petar Mladenov
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
Developer
Top achievements
Rank 1
answered on 18 Jun 2012, 09:04 PM
Hi,

We use a RadTreeView and RadGrid telerik controls in a page. While expanding and colapsing the tree nodes in RadTreeView, the sync is lost between the grid and TreeView.When I expand the tree node, the tree is expands behind the grid(Grid doesn't move down). When I move the mouse away the grid moves down. Same thing happens with the collapse. When I collapse the tree, grid doesn't move up, which results in a gap between the TreeView and the Grid. When I move the mouse the Grid moves up .
Please help me resolve this issue.

Thanks In Advance
0
Petar Mladenov
Telerik team
answered on 21 Jun 2012, 09:04 AM
Hi Developer ,

Could you please elaborate a bit on your scenario?  Is it possible for you to send us your XAML or an isolated sample in a new support ticket?It will be also great if you can send us a captured video with the issue you have come up with. What is the number of items in the RadTreeView and in the RadGridView? 

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
Faye
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Developer
Top achievements
Rank 1
Share this question
or