This is a migrated thread and some comments may be shown as answers.

Binding a lot of objects to TreeListView

2 Answers 73 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kirill
Top achievements
Rank 1
Kirill asked on 03 Feb 2017, 02:08 AM

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 Answers, 1 is accepted

Sort by
0
Kirill
Top achievements
Rank 1
answered on 03 Feb 2017, 02:21 AM
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.
0
Martin
Telerik team
answered on 07 Feb 2017, 02:15 PM
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.
Tags
TreeListView
Asked by
Kirill
Top achievements
Rank 1
Answers by
Kirill
Top achievements
Rank 1
Martin
Telerik team
Share this question
or