RadTreeListView poor performance

8 posts, 0 answers
  1. Andrew
    Andrew avatar
    5 posts
    Member since:
    Jan 2012

    Posted 17 May 2013 Link to this post

    Hi, 

    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)
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 May 2013 Link to this post

    Hello,

     
    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Andrew
    Andrew avatar
    5 posts
    Member since:
    Jan 2012

    Posted 22 May 2013 Link to this post

    Just install the nuget extension Didie - nuget package restore is on 
    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. 
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 May 2013 Link to this post

    Hello,

    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.

  6. Lee
    Lee avatar
    2 posts
    Member since:
    Feb 2013

    Posted 27 May 2013 Link to this post

    Scrolling=Deferred is not an option for us I'm afraid, tried that one and it was rejected by the clients - they want to see their content whilst scrolling. You'll note OnRowLoaded isnt being invoked, that was just one of many experiments to try to solve this.  

  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 May 2013 Link to this post

    Hello,

    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.

    Regards,
    Didie
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Lee
    Lee avatar
    2 posts
    Member since:
    Feb 2013

    Posted 29 May 2013 Link to this post

    How much simpler can we get than the reference project, it's using your windows8 (metro) theme! 
    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. 


  9. Nick
    Admin
    Nick avatar
    593 posts

    Posted 31 May 2013 Link to this post

    Hi Lee,

    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! 

    Regards,
    Nik
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready