Hi,
I am using UltraGrid with multiple child bands. I notice that the time to add a child band increases exponentially as the child band level goes higher and most time is spent on adding columns to a child band. All bands in my application have the same columns. Is there any faster way to add or clone a child band?
Your help is greatly appreciated!
Best Regards,Shaolin
Hello Shaolin,
To investigate this I will need some more information about your issue:
Looking forward to your reply.
Hi Milko,
Thanks for your reply!
All child bands are added at run time and a child band is added when it is needed. We use a virtual UltraDataSource and we use its event InitializeRowsCollection and CellDataRequested. Each band has only one child band with the same columns. The following is the code snippet we have:
UltraDataBand childDataBand = band.ChildBands.Add(name); foreach (IField field in fields) childDataBand.Columns.Add(field.Name, field.Type);
It worked and I appreciate your help.
Best regards,Shaolin
This issue comes from the fact that UltraDataSource has to notify its binding manager any time something changes in the data structure. This involves notifying recursively all parent bands. And yes, the time to finish this doubles with each level of child bands added.
What you can do, is to turn of this notifications by setting UseBindingSource property of UltraDataSource to false. With this I was able to add child band at 20th level for less than a half second.
Please let me know if you need any further assistance with this.
I was able to reproduce this behavior in a small sample project. I will discuss this with our more senior developers to see if this is an issue in our control, or if this is expected behavior. Actually, the time to add child bands up to sixth or seventh level of child bands depth is less than 200 – 300 ms in my sample. Therefore, the question here is what is the biggest child band depth you may reach?
I will get back to you as soon as I have more information about this issue.