Hi all,
I recently stumbled into the million rows example (virtual mode) for the WinGrid. That example works perfectly fast and reliable.
I my case I need to pull only 200.000 rows from a LinQ DataSource and display them in the WinGrid. Using the example I quickly succeeded in displaying these rows in just a few seconds.
That is where my problem enters the "game".I need conditional formatting based on the value of a hidden column (0/1) that should result in adding an icon to a cell in each row and in making the row "bold", based on the value (0 = normal + icon1 / 1 = bold + icon2).
My first guess was to add the "checking" to the InitializeRow event of the grid.The result was quite destructive to the performance.My second (more desperate guess) was to check all rows after loading and then do the formatting. That also didn't solve the problem and took far too long.
Would you mind to help me figuring out on how to archive my goal using the WinGrid?Maybe you could post the mentioned example using some conditional formatting as described?That would be great ;)Any ideas are kindly appreciated.
Thanks in advance and best regardsAndy
Hi Andy,
InitializeRow is the perfect place to do this. Only the rows that are loaded should be initialized and this fire the event. So if you are experiencing performance problems when using this event, you may be writing your code inefficiently and be forcing the rows to be loaded unnecessarily.
Can you post the code you had in InitializeRow?
Hi Mike,good hearing from you ;)
Here is the code you asked for that ran in the InitializeRowEvent:
// handling processing status in order to format the row the right wayswitch (readStatus){case 0: // unreade.Row.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;e.Row.Cells["readStatusIcon"].Value = (Bitmap) this.imgListEmailInbox.Images[1]; //removedbreak;
}
In the meantime I removed the Bitmap-Stuff that seemed to consume quite a lot of performance and it ran better. Still not sufficient enough to keep it this way, but I need an image there which I am now able to add via the CustomFormatting Tool on DesignTime.
I just started to work with the infragistics tools, so odds are pretty good that I miss something.
Thank you Mike for the time to look into this,have a great dayAndy