Partial Display of RadTreeList

1 Answer 64 Views
TreeList
Geof
Top achievements
Rank 1
Geof asked on 02 Jun 2022, 12:41 PM
I have a RadTreeList that is bound to a very large amount of data (100,000 + rows of data). The user is searching and is only interested in only part of the data, perhaps 20-30 rows anywhere in the data bound to the control. These rows will most likely be between child/parents within the treelist and wont have a nice parent/child relationship to display properly. What I want is to only be able to display a partial view of the data around what the user searched on and have the data look like a "snapshot" of the entire treelist. Has anyone done anything like this or are there any suggestions? Any help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 07 Jun 2022, 09:36 AM

Hello Geof,

The TreeList requires a strict parent/child relationship, so showing just a filtered portion would require some data manipulation after the filtering. 

One option to achieve this would be to obtain the filtered data, then, for each of the nodes to check if their parent is within the filtered set. If it is not, you change the ParentID to null, so this node becomes a root node.

Another option is to obtain the filtered nodes and then recursively get their parents until you reach the root parent. 

Regards,
Peter Milchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Latheesh
Top achievements
Rank 1
commented on 08 Dec 2023, 03:13 PM

I have a similar requirement and I think I understand what Geof wants to do.

Suppose he has 10 records in tree with pagesize 2.

Full Tree:

1
2
3
4
5
6
7
8
9
10

Let's say he wants to bind and show only page 3 data. He wants

 

In this case you are not binding level 0 (null) and level 1 data.

How can the treelist be created with level understanding ? Can it be tricked to believe that there are level 0 and level 1 items in previous pages ?

Regards

Latheesh

 

Attila Antal
Telerik team
commented on 13 Dec 2023, 10:47 AM

Hi Latheesh,

By setting the PageSize to 2 the TreeList will only render 2 items/page. Having that in mind, only items 1 and 3 will be displayed along with their child elements.

Regardless of the number of records you have in a data source, the TreeList only works with as many records as is defined by the PageSize. Think of it as the "Number of records on the current page".  Records concerning the other pages are ignored (not used), which means, that you can assign a data source of 10 million records, the TreeList will only go as far as finding the first two (PageSize="2") and display them in the browser. Performance-wise is not noticeable that 10 M records are bound to the TreeList.

About the question "How can the treelist be created with level understanding?" I assume you mean creating the TreeList that will automatically distinguish Root items from Child items. As Peter mentioned above, the Parent-Child relationship has to be strictly created. The TreeList requires you to define an ID for each Item as well as ParentID. For more details you can check out the Structure article.

Tags
TreeList
Asked by
Geof
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or