Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2005
How to avoid recreation of grid related objects
posted

Hello,

I am using an UltraGrid with virtual mode; the CellDataRequested event handler provides cell data from a data collection. The data in the collection are updated by a background thread. When the grid needs to refresh the follow statements are used:

_ultraDataSource.Rows.SetCount(_displayedViewRecords.Count);
_ultraDataSource.ResetCachedValues();
_ultraGrid.Rows.Refresh(RefreshRow.FireInitializeRow, true);

I noticed that most objects used within the grid are recreated:
One instance of each following class is created for grid:

Infragistics.Win.UltraWinGrid.DataAreaUIElement
Infragistics.Win.UltraWinGrid.UltraGridUIElement
Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement
Infragistics.Win.UltraWinGrid.RowSelectorHeaderUIElement

One instance of each following class is created for each row:

Infragistics.Win.UltraWinGrid.RowUIElement
Infragistics.Win.UltraWinGrid.RowSelectorUIElement
Infragistics.Win.UltraWinGrid.RowCellAreaUIElement

One instance of each following class is created for each column:

Infragistics.Win.UltraWinGrid.BandHeadersUIElement
Infragistics.Win.UltraWinGrid.HeaderUIElement
Infragistics.Win.TextUIElement

One instance of three or more classes is created for each cell.

I thought all the objects within the grid would be reused as much as possible. The data in my data collection are constantly updated and the grid performance is affected by the recreation of these objects within the grid. I am not sure if I have done something wrong.
Could someone point me in the right direction please?

Thanks,
Shaolin