TreeView for WinForms
オンデマンド読み込み

Users can use a technique called "delayed loading" where nodes are populated on demand when the user expands them. This allows the application to load faster and use resources more efficiently. The Load-On demand is an excellent alternative over fully populating each node when the application starts.

This image shows on-demand loading in TreeView.

The implementation below uses the event hander Expanding event, so that users can populate the node they try to expand it. In the code snippet below, we have saved the information we need to populate the node in the Tag property. Also, we add a dummy child node so the user will be able to expand this node and trigger the Expanding event that will populate the node.

Let's see how to implement the on-demand loading in TreeView, using the following code snippet:

Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
Note: TreeView for WinForms .NET 5 Edition has only runtime assemblies. Due to the new design-time model in VS2019 Preview, which is not complete yet from the Microsoft side, we do not supply any special design-time features as of yet. However, some of the controls might show up at design-time and allow editing few properties in the property grid.