J
Joe
I'm loading a TreeView with ~8900 root nodes and only a couple of child
nodes giving a total of 8910 nodes.
It takes several seconds for the tree to display. The method that populates
the tree returns in < .5 seconds.
Populating the tree in the Load event takes even longer than clicking a
button after the screen has been loaded.
try
{
treeView1.BeginUpdate();
foreach (DataRow dr in mytable.Rows)
treeView1.Nodes.Add(dr[mycol].ToString());
}
finally
{
treeView.EndUpdate();
}
Is there an Allocate method or property I can call or set before loading to
possibly speed it up?
Another thing worth mentioning is that the screen also takes ~1.5 - 2
seconds to close when the tree is loaded.
If I don't load the tree the screen opens and closes immediately.
nodes giving a total of 8910 nodes.
It takes several seconds for the tree to display. The method that populates
the tree returns in < .5 seconds.
Populating the tree in the Load event takes even longer than clicking a
button after the screen has been loaded.
try
{
treeView1.BeginUpdate();
foreach (DataRow dr in mytable.Rows)
treeView1.Nodes.Add(dr[mycol].ToString());
}
finally
{
treeView.EndUpdate();
}
Is there an Allocate method or property I can call or set before loading to
possibly speed it up?
Another thing worth mentioning is that the screen also takes ~1.5 - 2
seconds to close when the tree is loaded.
If I don't load the tree the screen opens and closes immediately.