Binding a lot of objects to TreeListView

3 posts, 0 answers
  1. Kirill
    Kirill avatar
    2 posts
    Member since:
    Jun 2016

    Posted 02 Feb Link to this post

    I need to bind hundreds of thousands of objects to TreeListView, potentially up to ~1-1.5 million at peak. Right now on my test set binding 350k of those objects takes 15-20 seconds. Is there any way to achieve at most a few seconds performance?

    I am working with existing data structure that is not homogeneous: root rows in my tree are objects, child roots are their fields which could also be potentially objects. They also can cross-reference each other, so creating all the structure at once would lead to endless recursion, that's why child rows are only created when the root is expanded. I don't think this actually matters much in this case, as I am talking about hundreds of thousands of root rows, they will be collapsed by default and expanded only one by one.

    But this means I have a slim wrapper around my initial data to create a class suitable for TreeListView binding which makes data homogeneous. There are only 5 columns/properties, and creating all of those objects and a bindable collection of them only takes ~1 second in my code, it seems that the rest is spent "pushing" data to UI.

    Another important thing is I just need to display a "snapshot" with that much data, it's static, there will be no changes to the collection, only manual editing of cells values user can perform (wrapper implements INotifyPropertyChanged). I tried adding a range of items at once with suspended notifications, recreating bindable collection from a previously prepared list each time it's loaded, but they all seem to offer the same 15-20 secs performance on a 350k set. Even then scrolling, roots expanding and filtering performance is terrible.

    I was looking at VirtualQueryableCollectionView, but as I understand, it doesn't work with local data, for example, from a list? Pagination is also something I was looking at, but then search/filtering only works within current page. Is there anything else I can do to make it faster?

  2. Kirill
    Kirill avatar
    2 posts
    Member since:
    Jun 2016

    Posted 02 Feb Link to this post

    Forgot to mention that, of course, virtualisation is enabled and I followed your Tips and Tricks for Performance, there are no extra styles, converters, colouring or anything like that, it's a plain simple TreeGridView with default templates.
  3. Martin Vatev
    Admin
    Martin Vatev avatar
    129 posts

    Posted 07 Feb Link to this post

    Hi Kirill,

    Another approach to speed up the performance of RadTreeListView is to use Lightweight Templates. Please tale a look at our Lightweight Templates article where you can find detailed information on the matter.

    I hope that this helps.

    Regards,
    Martin Vatev
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top