I'm having a little performance problem with the Telerik WPF hierarchical gridview & considering alternative 3rd party controls.
Check out this simple scenario (zip project) Its a RadTreeListView, bound up to an entity with a combobox to expand to each level. The performance is crap. I'm using the lightweight metro (windows8) style, and have overridden CreateCellElement as follows (and as recommended).
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
if (cell.Content != null && cell.DataContext == dataItem)
{
return (FrameworkElement)cell.Content;
}
return base.CreateCellElement(cell, dataItem);
}
Open it up, drag to fill the height of your screen, expand all items a couple of levels deep (using the combo, top left) and scroll around - it's extremely laggy. In my work version a similar scenario is entirely unusable, and I'm currently forced to loop through all expanded rows and dispatch 'ExpandHierarchyItems' calls which ties up the UI for ages, just to prevent a horrendous scrolling experience (extremely slow/massive UI lockups, nodes not expanded, no children, rows at wrong level). Latest version of telerik WPF, windows 7 x64 - slow on i7s, even slower on i5.
I'm now comparing this simple scenario with the alternatives (devexpress etc) ...
Has anyone got any suggestions for improving the performance? Or I'll take a definitive 'Telerik cant provide any better than this, and (something else) will' as an answer.
cross post from http://www.telerik.com/community/forums/wpf/treelist/radtreelistview-poor-performance.aspx
I just played your demo for a couple of minutes.
An error "Key cannot be null" occurred when I tried to edit the RadTreeListView template. The
ControlTemplate
is added in the resources, however it cannot be applied to the control. So I cannot play the template.For the performance, as far as I know, we could consider following aspects:
1) Layout
Looking at the visual tree of the RadTreeListView (you could use WPF Tree Visualizer), It contains several Grid recursively from the tree root down to the tree leave.
According to MSDN, The Layout System:
So the deeper your tree is, the greater the calculation will be.
You should try to avoid massive layout changes at the same time and try to use simpler panels in templates (DataTemplate and ControlTemplate)
And this link offers more details In what order are Panels the most efficient in terms of render time and performance?
2) Rendering
This is related to the WPF rendering implementation. BitmapEffect is an example.