RadTreeView - Performance when adding 20k+ Nodes

1 Answer 40 Views
TreeView
Marc
Top achievements
Rank 1
Marc asked on 10 Jan 2024, 01:50 PM

Greetings,

I am currently working on an ASP.NET WebForms application, which uses a Telerik RadTreeView.

The treeview uses has the tri state checkboxes active and gets populated server side. We first create a tree of stations (around 2500), which can contain other stations. After that, we populate the tree with datapoints by iterating over all stations and adding the datapoints with the Node.Add() Method.

So the structure is as follows:

Station
- Station 1
- Station 2
   - Station 4
      - DataPoint
      - DataPoint
   - Station 5

The checkboxes are used to show if any datapoint is already selected in the treeview and to select additional datapoints for a grouping.
There are multiple groups which can be switched between to see a different selection in the tree.

Therefore, it is necessary to add every datapoint that was already selected (and saved) to show the tri-state checkboxes correctly on page load.
After that a load on demand is possible.

What I tried so far:

  • Loading the stations and inserting the datapoints (20k objects) before adding the root node to the RadTreeView
    • Building the station tree is fast, but adding the root node to the RadTreeView Control takes about 600 seconds
  • Loading the stations and inserting the datapoints (20k objects) after adding the root node to the RadTreeView

    • Building the station tree is fast, but addings the nodes the the RadTreeView Control takes a long time

  • Loading the stations and adding the minimal amount of datapoints to display everything checked correctly with tri state checkboxes
    • Building the station tree is fast, but on every change of the grouping the tree will be walked completly to attach datapoints which were selected in the new grouping but where not present from the older groupings (or loaded on demand)

So my question is, is there a faster way to load about 20k objects into the tree, so on the change of grouping no new datapoints need to be loaded?

Or am I thinking this very wrong currently? Thank you in advance!

1 Answer, 1 is accepted

Sort by
0
Vasko
Telerik team
answered on 15 Jan 2024, 09:01 AM

Hello Marc,

Depending on the way the data is being bound to the TreeView, there can be some problems regarding the performance.

For instance, binding and displaying so many nodes to the TreeList while continuing to use PostBacks for various server operations is not a recommended practice. This is due to the fact that each node has an HTML structure that the server must render before the browser displays it. If there are many records, the server may not be able to manage the load, which might cause the loading time to rise and even crash.

With ASP.NET architecture, this is a widespread problem for which there is no fix. Implementing Load On Demand features and binding data on the client are the only ways to address performance difficulties pertaining to the volume of records.

For further information on the subject, I recommend taking a look at the following articles, with information relevant to the topic:

I hope this helps you out.

Kind regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Tags
TreeView
Asked by
Marc
Top achievements
Rank 1
Answers by
Vasko
Telerik team
Share this question
or