I'm looking for a wpf control (free or commercial). The tree should support all the regular tree view Characteristics (styles, data templates, control template, ...) and support being laid out with Columns (sort of like the Watch window in Visual Studio).
But also:
I don't want to build the tree myself, I'm looking for existing implementation with at least support for virtualization and data virtualization.
The best control I know who can apply your requirements is Telerik RadTreeView. Check out the demo. Pros:
The RadTreeView API supports UI Virtualization, which processes only information loaded in the viewable area, which reduces the memory footprint of the application and speeds up loading time thus enhancing additionally the UI performance
The performance of the Telerik RadTreeView control when operating with huge amount of items is significantly optimized through its load on demand feature. This mechanism lets the nodes load their child nodes as the user expands the parent by clicking on the “+” icon
The RadTreeView is a data-driven control, designed to display large amounts of hierarchical data and it does not provide searching, filtering and sorting functionality out of the box. Hence, such operations should be implemented on the data it represents. Example
The best example I've ever seen is TreeView by Josh Smith. It uses Load-On-Demand loading and has Text Search.
To include DataVirtualization
you should use:
<TreeView
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling" />
But be careful, Virtualization
only works when the TreeView
is using Binding
, and not when the nodes are generated one by one in the code like in the following example:
TreeViewItem rootItem = new TreeViewItem() { Header = "Item Level 0" };
for (int i = 0; i < 1000; i++)
{
TreeViewItem itemLevel1 = new TreeViewItem() { Header = "Item Level 1" };
itemLevel1.Items.Add(new TreeViewItem());
rootItem.Items.Add(itemLevel1);
}
Update:
You can use the DevExpress TreeList control. It is free-trial.
Or Telerik's TreeView control. It is 30 day free-trial. See their demos and you can even download and try them.
Update1:
If you have any doubts about performance TreeView by Josh Smith, then I can say about my experince:
TreeView
does not absolutely violate MVVM rules, cause it uses viewModels
for TreeViewItems
. It means you will not meet strange errors or exceptions if you would have TreeViewITem
in your viewModel
. For example, this error.To conclude, I would like to say I am really glad that I've chosen TreeView by JoshSmith
in my production application cause it is really simple to support and edit it. It has really great performance.
Photo of my TreeView
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With