Back
Assuming your treeview is named treeview1 perform the following after loading your node collection:
....treeView1.ExpandAll();
//or
treeView1.CollapseAll();