Grid performance issues

lastbudget and lastactual are both Lists

These lists populate 2 columns in an infragistics ultragrid

  • PrevFY
  • Actual_c

So the grid has defined datasource already. These 2 columns I added programmaticly onto the grid which has a datasource.

(dgvBudget is the name of the ultragrid)

int rowIndex = dgvBudget.Rows.Count;


if (half == "Second Half Budget")
{
    for (int i = 6; i < rowIndex; i++)
    {
        var row = dgvBudget.Rows[i];
        row.Cells["PrevFY"].Value = lastbudget[i];
        row.Cells["Actual_c"].Value = lastactual[i];
    }
    for (int i = 0; i < 6; i++)
    {
        var row = dgvBudget.Rows[i];
        row.Cells["PrevFY"].Value = lastactual[i];
        row.Cells["Actual_c"].Value = 0;
    }
}
else
{
    for (int i = 0; i < rowIndex; i++)
    {
        var row = dgvBudget.Rows[i];
        row.Cells["PrevFY"].Value = lastbudget[i];
        row.Cells["Actual_c"].Value = lastactual[i];
    }
}

How could I write this to take less time? This works, but it is taking 8 seconds to fill the grid with the data. Any help would be appreciated!

Here Mike of Infragistics explains the different ways to obtain grid performance.
https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/15306/wingrid-performance-guide

2 Likes

I would like to bump this in hopes to get some help with my situation rather then someone just posting a link and providing no context.

So basically what you want is for us to read the post Mike (the God of Infragistics) posted so kindly explaining all of the different ways to get grid performance and then tell you how to fix your problem. Not often will I quote the bible but β€œSome men are so lazy they won’t even feed themselves.”

5 Likes