I have an UltraGrid, with about 40 columns and 10000 rows. Most columns are strings, but a couple are DateTimes or objects. The UltraGrid datasource is bound to a DataSet with only one table. Only the visiblerows are being updated with data, with the data being updated on a row by row basis fairly often. Somehow, the grid is ultra, ultra slow, and at higher resolutions it takes a long time to scroll up and down, and left and right too. I am wondering why this is? I notice Infragistics WinForms are still on .net 2.0 - .net 3.5 supposedly sped up DataSets heavily. Do you have any other ideas for why this is so slow? It is a serious problem.
It's hard to say what's causing it to be slow without knowing more about what your application is doing. But I have a few suggestions:
1) Set Visual Studio to break on all run-time exceptions. If exceptions are occurring and being caught, this can cause serious performance issues.
2) If you are using ValueLists in any columns, try turning them off and see if that makes any different. Obviously, removing your ValueLists is not a solution, this is just a test.
3) Set SynchWithCurrencyManager to false and see if that helps.
4) Check out the CellDisplayStyle property of the column. You can improvide performance by using this property to turn off features you are not using.
5) If you are applying appearances in the InitializeRow event of the grid, try commenting them out and see if that helps.
Thanks for the reply. I have no valuelists, no InitializeRow event, and I tried debugging and seeing any thrown exceptions, but none are thrown. SynchWithCurrencyManager had no noticable effect (I have no formulas). Unfortunately what is bizarre to me, is that I've commented out all of the sections that actually update the grid, and the grid is slow just being bound to a dataset itself of 10,000 rows / 40 columns (with no points filled in at any time after initial points from dataset). This dataset is not bound to any database, it's just purely a dataset object with datatables and rows. It doesn't help performance not filling in points, so I'm thinking there's something strange going on with the Grid. There are no colors or bitmaps, although I do have two cell button clicks inside the grid, and some of the columns are custom types (such as datetime or object, all with the ToString() called [I assume]), and there are some booleans. Removing the custom types didn't seem to help though either.
Well, the only thing on my list that you did not mention is the CellDisplayStyle. That might help.
Another thing is... try wrapping your DataSource in a BindingSource object. That might help - Microsoft made some changes to the binding manager in CLR2 that can cause serious performance issues if you bind without using a BindingSource.
What version of the grid are you using? If you have a really old version, perhaps there have been performance improvements in the newer releases.
I'm pretty sure I also changed the style and nothing improved unfortunately. I also had noticed the binding thing in your notes from VS2005 (I'm using 2008), and that didn't seem to make any difference. I'm using version 8.2 of Infragistics, but it says .net 2.0 even though it's in the 3.5 pack. Anything else you can think of that will really speed up performance? Anything that can be turned off that would significantly help or anything like that?
I recommend you profile it to try and determine what's taking so long.
Case in point: I was also getting really slow grid performance recently. One of my grids just _crawled_. I ran a profiler (JetBrains dotTrace), and it told me that most of the time was being spent drawing, which told me that the grid was having to work harder than it should to keep painting the screen. I started listening the grid's Invalidated event and looked at the parameters. With each change to a row, the ENTIRE grid's rectangle was being invalidated instead of just a Rect that encompassed the changed row. (Not relevant to you, but interesting: This was due to a strange way that .NET handles databinding when your object has a property that is a list. .NET will fire Reset events on that list subproperty even when there are just changes in other properties of the object. Combine that with a grid that has sub-bands, and the grid will keep thinking that it has to refresh ALL rows because the sub-bands keep being reset).
Since you don't have sub-bands (that you've mentioned), I don't think you're hitting the same thing, but the point is just that with some profiling and debugging, you can probably discover the root cause.
Good luck!
We had a Grid with these scrolling issues in connection with the mouse wheel.
The scroll performance returned to normal, after we removed the ColumnHeaderTextOrientation in the DisplayLayout.Override ?!?!
With ColumnHeaderTextOrientation = Horizontal90Degrees the grid is only redrawn after releasing the mouse wheel and with a delay of 2-3 seconds. Without the Header-Rotation the grid draws with each scroll of the mouse wheel.
This is the exact performance issue I am having with performance on my UltraGrid object. After running a trace the application is redrawing everything instead of just the changed sections of the grid. Takes the screen about 80 seconds to refresh. How did you change the control to only redraw the invalidated sections of the Ultragrid control?
I'm sure it's because it keeps redrawing it, I just can't figure out why (when no data in the dataset is changing). It's especially bad when I use the mouse wheel, if I scroll down a couple, then up, it's way lagged and behind. I'm sure it's redrawing too much, just having trouble figuring out why.
Yeah, profiling is probably your best bet at this point. Or, if you can duplicate the problem in a small sample project, you could Submit an incident to Infragistics Developer Support and ask them to take a look.