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
240
Performance with UltraTree and adding Node the second time
posted

Hello,

I use Version 12.1 and have a problem with the performance when adding nodes. In my sample program I have the following code:

         this.ultraTree1.BeginUpdate();
         var watch = Stopwatch.StartNew();
         this.ultraTree1.Nodes.Clear();
         for(int i = 0; i < 5000; i++)
         {
            var node = new UltraTreeNode
            {
               Text = i.ToString()
            };
            ultraTree1.Nodes.Add(node);
            var b = node.Bounds; // this needs the time
         }
         watch.Stop();
         Debug.WriteLine(watch.ElapsedMilliseconds);
         this.ultraTree1.EndUpdate();

When I use it the first time the performace is ok. On my machine ElapsedMilliseconds ~ 400. The second time the ElapsedMilliseconds ~ 9000. Is their a solution to have a better performance when I use it the second time? In the real program I need the Bounds property to make some calculation how large is the necessary wiidth of the control to suppress the horizontal scroll bar.

Thanks Joachim

Parents Reply Children
No Data