Explain the next headline, where I get the data through webservice and load it dynamically into the TreeView node. Then it is not a child node until a node is expanded. Then it does not display the plus sign. This causes the user to mistakenly assume that the node cannot be expanded. I do this, each time you create a node A, the default is that it creates a child node B (just give a name, if it is "hehe"), then the creation of Node A will have child node B, will also show the plus sign, and so on, and then expand Node A, and then remove the child Node B, which was created just before, The deletion method is to infer whether the expanded node A has a child node and the name is "hehe". If it is true, delete it.
Of course, this leads to a small problem, because the webservice I call is only able to fetch each level of TreeNode layer by level, so let's assume that the above method is used. To the last layer of the node. The plus sign is still displayed before this node. The solution I'm thinking of is to call the service to infer if the node has child nodes before this node is expanded, and if so, create a default child node for it. Suppose you don't create a default child node, but it's too expensive to invoke a service when you expand. If the great God thought of the solution to the problem, please enlighten me.
Show the plus sign before the TreeView node when loading the TreeView dynamically