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.
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. Any suggestions? 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.
I'm now comparing this simple scenario with the alternatives (devexpress etc) ...
cross posted here: http://stackoverflow.com/questions/16623749/telerik-radtreelistview-poor-performance
duplicate of http://www.telerik.com/community/forums/wpf/gridview/radtreelistview-poor-performance.aspx (wrong channel)
8 Answers, 1 is accepted
Thank you for sending us a demo project. I tried to run it, but there are many missing references. Would you please attach the references you use, so that I can run the project?
Generally I can suggest you to go through the Tips and Tricks help article suggesting on how you could improve the performance.
Regards,Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Edit: I've updated the zip with dlls for anyone not using nuget
Nothing in the tips & tricks helps ... feel free to check over the solution.
I have tested the scrolling. What I can suggest in this case would be to set ScrollMode="Deferred". That way the scrolling performance will be improved.
Then I see that you set the IsExpanded state when the RowLoaded event is raised:
private
void
OnRowLoaded(
object
sender, RowLoadedEventArgs e)
{
var row = e.Row
as
GridViewRow;
if
(row !=
null
)
{
var person = (Person)row.DataContext;
if
(row.IsExpanded != person.IsExpanded)
{
row.SetValue(GridViewRow.IsExpandedProperty, person.IsExpanded);
}
}
}
The RadTreeListView supports UI Virtualization as explained in this help article. Since the virtualization is turned on by default, it is not recommended to work with the visual elements (i.e. Rows) and their properties.
Generally we recommend controlling the expanded state through using the IsExpandedBinding property as demonstrated on the "IsExpanded binding" WPF Demo.
Please try those two suggestions and let me know how they work for you.
Regards,
Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Indeed when there are a lot of visual elements (especially expanded in many hierarchy levels) scrolling performance will degrade significantly as all the rows should be created as they are brought into view.
You can try to remove some visual elements and use Implicit Styles - for example you could use reduce the number of visual objects of the TreeListVIewRow and GridViewCell.
Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
This doesnt seem like it should be so much worse performing than scrolling a normal non-hierarchical grid, the same rows need to be created in both scenarios.
Unfortunately currently this is a limitation of the TreeList control. The problem is that the rows that are generated may have hierarchy that has to be loaded, measured and rendered as well.
Currently we are working on creating more lightweight templates for our controls that will drastically boost the rendering performance resulting in better user experience.
Nevertheless, until the mentioned templates are released, you can use the approach Didie has suggested in her previous reply.
We are sorry for any inconvenience caused!
Nik
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I know this post is old, but has anything been done to improve it?
I am facing this problem yet.
Version 2020.2.513.45
Indeed, WPF is still actively used.
As for the performance, there are many modifications created between the versions, but the general issue here is that the WPF framework is not performant in scenarios with big amounts of items rendered at once. I would recommend you to check the Tips and Tricks article and try the suggestions there. If those don't help I would suggest you to open a new support ticket along with your project showing the troublesome performance.