I am using a `TreeView` to show a folderstructure. I dynamically create nodes in the `NodeMouseClick` event. 

But even though the child nodes are populated, they are not visible in the treeview. 

However, minimizing the window and maximizing it again solves this issue. Please let me know what I am doing wrong here. Please find below the code that I am using:

```
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
    {
        if (treeView1.SelectedNode != null && e.Node.IsExpanded)
        {
            treeView1.BeginUpdate();
            TreeNode node = e.Node;
            while (node.Parent != null)
            {
                node = node.Parent;
            }
            VcDetailsEntity detailsEntity = connectedVCs.Where(c => c.VCName == node.Name).FirstOrDefault();
            detailsEntity.VCBrowserPath = e.Node.Name;
            FolderBrowser cosmosBrowser = new FolderBrowser();
            List<FolderStreamEntity> folderStreams = folderBrowser.GetVcContentDetails(detailsEntity);
            e.Node.Nodes.Clear();
            foreach (var stream in folderStreams)
            {
                if (stream.IsDirectory)
                {
                    TreeNode treeNode = new TreeNode();
                    treeNode.Name = stream.StreamName;
                    treeNode.Text = stream.QualifiedName;
                    treeNode.ToolTipText = stream.QualifiedName;
                    TreeNode dummyNode = new TreeNode();
                    treeNode.Nodes.Add((TreeNode)dummyNode.Clone());
                    TreeNode toUpdate = treeView1.Nodes.Find(e.Node.Name, true).FirstOrDefault();
                    toUpdate.Nodes.Add((TreeNode)treeNode.Clone());
                }
            }
            treeView1.EndUpdate();
            treeView1.Refresh();
        }
    }

```

I have tried the suggestions provided by Gnial0id, wpfnoop and LarsTech here below. But no luck. Temporarily I have resolved it by minimizing and maximizing the form programatically.