Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4165
Out of Memory with Icons?
posted

I have a tree that I am generating that can possibly generate 1000's of nodes. Each node has an icon and text.

In situation where I have a couple of hundred, no problem. When I get into the 1000's, I get 'Out Of Memory' errors. If I take out the icons, no issue.

Not sure where to start with this, but I have an imagelist with 16x16 icons...png's. (Very small)

Here is an example of how I am generating certain levels of the tree:

UltraTreeNode worknode = null;

public void GenerateDash(UltraTree tv)

{

worknode = tv.GetNodeByKey(SQLReader.GetString(21) + SQLReader.GetInt32(24));
if (worknode == null)
{
if (sid)
   worknode = tv.Nodes[SQLReader.GetInt32(24) + "mc"].Nodes.Add(SQLReader.GetString(21) + SQLReader.GetInt32(24), SQLReader.GetString(21));
     else
   worknode = tv.Nodes["me"].Nodes[SQLReader.GetInt32(24) + "emp"].Nodes[SQLReader.GetInt32(24) + "mc"].Nodes.Add(SQLReader.GetString(21) + SQLReader.GetInt32(24), SQLReader.GetString(21));
worknode.LeftImages.Add(tv.ImageList.Images[12]);
 }
if (tv.GetNodeByKey(SQLReader.GetString(21) + SQLReader.GetInt32(24) + SQLReader.GetString(22)) == null)
 {
 worknode = worknode.Nodes.Add(SQLReader.GetString(21) + SQLReader.GetInt32(24) + SQLReader.GetString(22), SQLReader.GetString(22));
 worknode.LeftImages.Add(tv.ImageList.Images[35]);
}
else
 worknode = tv.GetNodeByKey(SQLReader.GetString(21) + SQLReader.GetInt32(24) + SQLReader.GetString(22)); 

}

Before this I had a standard .net tree which generated the same amount of nodes with the icon with no issue.

 

Thanks.