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
BB said:Isn't there a way to refer to Images using ImageIndex.
I don't understand what you mean. What's an ImageIndex?
Mike Saltzman said:If the images are slowing it down, then you might want to use a DrawFilter or a CreationFilter to provide the images, instead of using the cell value. The advantage of the DrawFilter/CreationFilter is that you only supply the images to the cells that are actually displayed on the screen instead of all of the images in every row.
Isn't there a way to refer to Images using ImageIndex.
Hi Mike,
thanks a lot for your support. I am going to check out the post you mentioned.
have a great weekend,best regardsAndy
Hi Andy,
Well, if you are certain that it's the code in InitializeRow that is making the difference in performance, then I guess checking the performance guide is a good idea. But I really don't see how anything you are doing there could slow down the grid in any significant or noticeable way.
If the images are slowing it down, then you might want to use a DrawFilter or a CreationFilter to provide the images, instead of using the cell value. The advantage of the DrawFilter/CreationFilter is that you only supply the images to the cells that are actually displayed on the screen instead of all of the images in every row.
There's a discussion of this technique here: Initialize rows as they are displayed, or Win equivalent for LoadOnDemand property - Infragistics Community
first of all, I really appreciate your help. I will definitely check out the WInGrid PerformanceGuide before proceeding any further.
Regarding the loading of the rows. I am not quite sure if I understood the question correctly, but I have set the LoadStyle of the Grid to LoadOnDemand.The Event seems to fire for all rows (at least for a couple of hundreds, that was when I stopped debuggin it).
Let me know if you need any clarification,
have a great day,best regardsAndy