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.
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: