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);
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.
It worked and I appreciate your help.
Best regards,Shaolin