I have a collection of objects that I set as the DataSource of an Ultragrid. It doesn’t matter if I have 40 or 4000 objects in my collection when I use the scroll wheel to scroll the grid it is extremely slow. Now if I scroll using the scroll bar by clicking and dragging it the grid scrolls very fast and is as responsive as I would expect it to be.
The objects that are being displayed have many public properties (somewhere around 500) but I’m only showing 10 of them in the grid and the rest are hidden. I even hooked my app up to a profiler and couldn’t see any significant activity going on in my app when the grid was being scrolled with the scroll wheel.
I have read through a lot of posts here and can’t seem to find what I’m looking for. One post suggested I do 4 things:
1) Make sure there were no exceptions being thrown (no exceptions are being thrown).
2) See if the grid was using ValueLists (I’m not using ValueLists).
3) Set the SynchWithCurrencyManager to false (I did with no change to speed).
4) Try using different CellDisplayStyles (none were faster than the other).
That post also mentioned something about InitializeRow but I’m not using that event. Is there anything else that would be causing the ultragrid to scroll slowly?
Any help would be much appreciated, thanks
Daren
FYI, I changed the grid.DisplayLayout.LoadStyle = LoadStyle.LoadOnDemand and the scrolling is much quicker.
Hi Daren,
If you have not already done so, I recommend checking out these two threads:
WinGrid Performance Guide
Wingrid Performance and DataSources - Infragistics Forums
If none of that helps, see if you can post a small sample project demonstrating the issue and I will be happy to take a look and figure out what's causing the slowdown.
Thanks for your reply Mike.
No I'm not displaying any hierarchical data but I do have non-displayed properties that are objects. So I did set the MaxBandDepth to 1 with no speed improvements. I also tried using a BindingSource but that didn't help either.
I am doing the same thing with other object collections that don’t have as many properties and don’t display as many columns in the grid and they scroll much faster. Any other ideas?
Hi Darren,
Is your grid showing a hierarchy of data? Do the object you are binding to have properties that return Lists or BindingLists? If so, try setting MaxBandDepth to something like 5 and see if that makes any difference.
Another thing to try would be to use a BindingSource instead of settings the grid's DataSource directly to your list of objects.