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.