I would like to find out a way to improve UltraGrid's performance for the following simplified use case:
- DataSource consists of a parent-child relationship, with 2 tables having 5000 records each, and an one-to-one relationship between records;
- For the first time, it will take about 1 min 40 sec, whenever you invoke grid code which enumerates ChildBand rows.
foreach( UltraGridRow group in _ultraGrid.Rows )
foreach( UltraGridChildBand band in group.ChildBands )
foreach( UltraGridRow item in band.Rows ) { // Some code here ... }
Thanks a lot for your help,
Horea
PS
If needed I will provide the sample code.
Horea,
Without knowing exactly what you are doing, I will offer a suggestion: Don't iterate through the UltraGridRow collection itself.
I have found that when I need to work with the data displayed in the grid, it is generally faster work with the DataSource object itself. For example, if I were to be bound to a System.Data.DataSet as you described, I would iterate through the System.Data.DataRow collection from the tables instead of the bound rows in the grid.
I have taken such steps in the past and have seen quite noticable speed improvements in the processing of some of my WinForms.
Cheers,
P.J.
PJ,
Thank you for your input! Your suggestion is a workaround solution, which I had considered, but I was wondering if the Infragistics team has something to say about this issue .
I have a special case where I do implement a custom Find/Filter feature and I need to be able to expand/select certain rows.
Thanks,
I'm not from Infragistics Team, but I have to say something :)
In order to show the subordinated rows for each parent row they need to create DataViews on the child table. And this operation is not very fast. I'm pretty much sure that there is a bunch of optimization potential here (in my case it hit me when exporting datagrid into excel. This straight-forward approach is too inefficient in this case). But this certainly cannot be changed in the short run.
I also think that the best approach here is to implement your functionality by operation with the datasource. At least for the case of "find" it is (very probably) doable. If you will explain more what you're actually doing, then maybe somebody can help you.
BTW, I've reported another bug in my excel export story. The problem was that these DataViews were initialized twice (may be only for export, not sure).
See bug report BR26018
There are hotfixes for versions 7.2 and 7.3