How to expand many nodes

2 posts, 0 answers
  1. koala
    koala avatar
    6 posts
    Member since:
    Apr 2015

    Posted 18 Apr 2016 Link to this post


    I have the following TreeListView.

      AutoExpandItems="{Binding IsToggleExpand}"
      IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}"


      ItemsSource="{Binding FolderDataView}"
      SelectedItem="{Binding SelectedItem}"

    I use IsExpanded/IsExpandedBinding to open a node and I use IsToggleExpand/AutoExpandItems to open all nodes. Everything works correct.

    If I reopen my Tree I have to expand all nodes of the last session. So I store the expand state when closing and use IsExpanded to open the nodes when opening. If I open many nodes it is very slow (flickering). And the ScrollViewer does not recalc its correct size. Perhaps the UI refreshes too often.

    If I expand all nodes with IsToggleExpand/AutoExpandItems it is much faster and the ScrollViewer resizes correctly.

    How can I improve the user experience and the performance when opening many nodes?


  2. Dilyan Traykov
    Dilyan Traykov avatar
    613 posts

    Posted 20 Apr 2016 Link to this post


    Thank you for the provided information and code snippets.

    The problem here is that the data structure behind RadTreeListView is constructed dynamically based on the Load on Demand approach. This ensures minimal memory consumption with large hierarchies. Since the IsExpanded binding can only be evaluated on loaded items it looks as if the hierarchy is expanding runtime.

    The case with AutoExpandItems is different as it directly sets all rows IsExpanded property by using RadTreeListView's ExpandAllHierarchyItems() and CollapseAllHierarchyItems() methods.

    A simple solution I can offer in order to improve the user experience is to set the ScrollMode of your TreeListView to Deferred.

    I hope you find this information helpful.

    Dilyan Traykov
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top