Home - Forums-.NET - FlyTreeView (ASP.NET) - 45 sec to populate 1000 nodes?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

45 sec to populate 1000 nodes?
Link Posted: 08-Jan-2007 04:11
Is this normal time needed to populate around 1000 nodes when forceinit used?
Link Posted: 08-Jan-2007 13:42
Yes, it is. ForceInit is a bad thing for performance considerations.

That is why FlyTreeView initializes its nodes on demand be default.
Link Posted: 08-Jan-2007 21:48
[quote="EvgenyT"]Yes, it is. ForceInit is a bad thing for performance considerations.

That is why FlyTreeView initializes its nodes on demand be default.

We exactly have the same problem. It lasts 2 minutes to populate 4000 nodes.
What would be the best way to have correct performance considerations ?

Thank you for your help.
Link Posted: 08-Jan-2007 22:43
The best approach in the case is to split nodes into branches and load then on demand.

Every treeview node is a complex HTML structure, it requires browser to spend a lot of time to render thousands of nested tables, images and so on.

Split nodes into sets and load them on demand.

For FlyTreeView for ASP.NET 1.1, use the NodeSrc property (see online examples).

For FlyTreeView for ASP.NET 2.0 use the FlyTreeView.PopulateNodes event handler (see online examples).
Link Posted: 09-Jan-2007 04:36
Hi, thanks for your answers so far.
But i can't find the online examples.

- for now i coded in treeview's itemdtabound : e.Node.PopulateNodesOnDemand = True
is it of any help ?

- for the treeview NodesPopulate, do you suggest something like :
        If Not CBool(e.Node.Expanded) Then
            e.Node.Remove()
        End If
I don't see anything else that could fasten the loading ... (?)

- shall i shorten the xmldatasource lines (too many attributes), i think it's more about the number of line, no ?, rather than their length

Thanks
Link Posted: 09-Jan-2007 06:21
- for now i coded in treeview's itemdtabound : e.Node.PopulateNodesOnDemand = True
is it of any help ?

Yes.

Then you should just set the FlyTreView.PopulateNodes handler.
The hanlder is automatically called when a user expands the node (having PopulateNodesOnDemand = True and no child nodes).

Refer to filesystem example on how it is implemented.
You just need to use databinding instead of programmatic way to add child nodes.