0
votes

I followed the following tutorial (answer) to create a treeview which is bound to datatase, the only exception being that I have my treeview in a user control.

Populate WinForms TreeView from DataTable

My problem is that after adding a new node or child node the tree doesn't get updated. I have tried to refresh, expandall etc the tree but still doesn't show the newly added node. Bear in mind it is in usercontrol and I'm adding new nodes from parent form.

1
Can you post the code you are using to add an item to the tree?seanzi
it is the same code in stackoverflow.com/questions/805457/…James
Are you sure that a node is being added to the treeview? how can you be sure that the nodes are really added but you just cant see them? Use some breakpoints and see what is going on.Saeid Yazdani

1 Answers

2
votes

You might try TreeView.BeginUpdate() and TreeView.EndUpdate() methods as well, before and after the responsible code for altering nodes to your treeview.