Skip to content

Fast way to add a child band

New Discussion
SHAOLIN XIONG
SHAOLIN XIONG asked on May 31, 2017 9:30 PM

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

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on May 25, 2017 9:46 AM

    Hello Shaolin,

    To investigate this I will need some more information about your issue:

    • How do you add child bands to your UltraGrid? Is it design time process or is it runtime? Can you give me the exact steps or code you are using?
    • What type of data source your grid is bound to? Is it DataTable, DataSet, some collection, or something else?

    Looking forward to your reply.

    • 0
      SHAOLIN XIONG
      SHAOLIN XIONG answered on May 25, 2017 2:59 PM

      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);

      Your help is greatly appreciated!

      Best Regards,
      Shaolin

      • 0
        Milko Venkov
        Milko Venkov answered on May 30, 2017 11:21 AM

        Hello Shaolin,

        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.

      • 0
        Milko Venkov
        Milko Venkov answered on May 30, 2017 8:42 PM

        Hello 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.

      • 0
        SHAOLIN XIONG
        SHAOLIN XIONG answered on May 31, 2017 9:30 PM

        Hi Milko,

        It worked and I appreciate your help.

        Best regards,
        Shaolin

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
SHAOLIN XIONG
Favorites
0
Replies
5
Created On
May 31, 2017
Last Post
9 years, 3 months ago

Suggested Discussions

Tags

Created by

Created on

May 31, 2017 9:30 PM

Last activity on

May 31, 2017 9:30 PM