If you are talking about how to add data and refresh it after all data has been added, the standard technique is to call BeginUpdate(); just before you start adding data and EndUpdate(); after you have added the data. Once you have done this, call Refresh();. It would look something like this:
private void PopulateTreeview(TreeView treeView)
{
treeView.BeginUpdate();
try
{
}
finally
{
treeView.EndUpdate();
treeView.Refresh();
}
}
I use a try/finally to make sure I finish the update part, and refresh the control. This helps to cope with times when the act of loading data into the treeview throws an exception. I don't catch the exception because there's nothing I can do with it in here and I want to use good practices for handling exceptions.