Superfluous
2015-04-07T13:18:18Z
Hello everyone,

I wonder if anyone could give me any suggestions on this. I'm currently using iGrid 2.50.21.0 in a .NET 3.5 WinForms application, and one of the requirements is to make rows which meet a certain criteria (a cell value bring 1 instead of 0) trigger the cell or row's background colour to change. The problem is speed; when we're talking in the region of 5000+ rows then it starts to slow down considerably. Currently I:

* Read in the data from a MySQL source into a DataTable
* Fill the iGrid using that DataTable
* Run through all available rows, and test cell x on that row; if it matches then recolour the row (change backcolour and forecolour)

Is there any way to do this based on visibility? For example, when the grid is redrawn, evaluate only the row(s) which are visible and then use this logic on them? This would theoretically decrease the user's "load time". It's definitely the bottleneck - the server is on the local network and can populate the DataTable in under a second. It's just my coding approach that's slowing things down!

Many thanks in advance for any suggestions, comments, etc :)

-Andy
Igor/10Tec
2015-04-07T13:47:58Z
The CellDynamicFormatting event should help you.

Below is a pertinent example from the help, when we highlight rows with values in the Price column greater than 10:

private void iGrid1_CellDynamicFormatting(
  object sender, iGCellDynamicFormattingEventArgs e)
{
  if((int)iGrid1.Cells[e.RowIndex, "Price"].Value > 10)
    e.BackColor = Color.BackRed;
}