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
45
WinGrid Performance - time to bind when grouping
posted

Mike,

Good article (WinGrid Performance Guide). Just wanted to query about a strange performance issue we are facing and not sure if it falls into any above mentioned sections.

We are displayed records using binding source in a UltraGrid.

The number of records range from some 400-500 rows.

Additionally, we are allowing the user to group the grid columns. When grid grouping is done using

4-5 columns, binding of the grid takes a lot of time. If there grouping is removed completing,

the binding is quite fast.

Its seems to be that time to bind increase depending on the number of columns being grouped.

Additionally, during this time, the CPU on machine spikes depending on the binding and grouping of columns. Not sure if this has been noticed.

Please advice.

Regards,

Ravi Bhotla

Parents
No Data
Reply
  • 255
    posted

    I had an issue that sounds similar to yours. I had posted it(and a solution) in this thread but it seems to be missing now. Is it slow the first time you bind or only on subsequent bindings? If it's the later, I found doing something like this(on binding) seemed to solve the problem:

    if (m_BoundDataTable != null)
    {//if we're already bound to something

        //clear data source without resetting the appearance
        BindingSource emptyBindingSource = new BindingSource(m_BoundDataTable.Clone(), null);
        GridSummary.DataSource = emptyBindingSource;
    }

    BindingSource bindingSource = new BindingSource(dataTable, null);
    GridSummary.DataSource = bindingSource;
    m_BoundDataTable = dataTable;

    So basically you just clear the binding and re-bind from scratch everytime. Otherwise it seems to be doing some kind of comparison with the values already shown on screen which is extremely slow, and gets exponentially slower the more bands and rows there are...

    Hopefully that helps.

Children
No Data