简体   繁体   中英

asp.net async treeview

I am trying to build a dynamic treeview which is populated when the user clicks on one of the pluses. on my database I have records which work like parent and child, so a record has link to its parent record and link to all its child records (I think the way the database works is not relevant so im not going to explain). The issue is some of the records may have upto 1000000 child records and as you can see loading all of them at once can cause some issues as you may be loading millions of nodes at once.

so I was wondering if any one had some goof tutorials on treeviews.

1 - Set the TreeView.ExpandDepth to 0 . This eliminates the expansion of the added TreeNode objects in the TreeView and shows the expansion symbol [+] next to each TreeNode that has the TreeNode.PopulateOnDemand property set to true.

2- Set the TreeNode.PopulateOnDemand to True for each branch TreeNode. When the TreeNode.ChildNodes collection is empty, the expansion symbol [+] will be showed only next to TreeNode objects that has TreeNode.PopulateOnDemand property set to true .

3- Handle the TreeView.TreeNodePopulate event to poulate branch nodes on expansion. This event will be fired when a TreeNode - with the TreeNode.PopulateOnDemand set to true - has been expanded right before the TreeView.TreeNodeExpanded event gets fired.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM