Hi,
I have tree with thousands of nodes (up to 2 000). Loading is quite fast thanks to AddRange method in Nodes property. Now I have a task to set many of the nodes (or each of them) to Selected = true. There is very bad performance with that.
Code looks like that:
foreach( UltraTreeNode childNode in Nodes)
{
if( someCondition)
childNode.Selected = true;
}
Profiler says, that most of the time is spent in node.Selected = true (more specifically SelectedNodesCollection.InternalAdd and finaly ArrayList.Contains - this is the problem). I was trying to find something like SelectedNodes.AddRange method or something like that but with no success. What can I do to speed up nodes selection ? Thanks for any advice.
Daniel
Hi Daniel,
The performance problem is most likely caused by the contanst painting of the control. Try this:
tree.BeginUpdate();
try
finally
tree.EndUpdate();
I've already tried this..still very slow, because problem is not with constant redraw, but with slow ArrayList.Contains method. I'm using 2008 vol.1 version of Infragistics WinForms, I have vol.2 . We are going to use new version in a few weeks, but I'm not sure it helps. Got some other tips ? Thanks