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.DataAreaUIElementInfragistics.Win.UltraWinGrid.UltraGridUIElementInfragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElementInfragistics.Win.UltraWinGrid.RowSelectorHeaderUIElement
One instance of each following class is created for each row:
Infragistics.Win.UltraWinGrid.RowUIElementInfragistics.Win.UltraWinGrid.RowSelectorUIElementInfragistics.Win.UltraWinGrid.RowCellAreaUIElement
One instance of each following class is created for each column:
Infragistics.Win.UltraWinGrid.BandHeadersUIElementInfragistics.Win.UltraWinGrid.HeaderUIElementInfragistics.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
Hello Shaolin,
This is expected behavior. Each time a cell value changes the related CellUIElement invalidates and repaints. Actually everything you see on the screen is drawn via hierarchical structure of UIElements. This is a core concept in most of Infragistics Controls for Windows Form. You may follow the next link to our online documentation to find more information about our Presentation Layer Framework http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Win_Presentation_Layer_Framework_PLF.html.
One thing you may change in your code is to call Refresh of the grid rows with RefreshRow parameter set to ReloadData like this:
this.ultraGrid1.Rows.Refresh(RefreshRow.ReloadData, true);
This way you will not force the grid to reinitialize all its rows again.
Please tell me exactly what your issue is? Do you face some bad performance? How big your data is? How much rows and columns your grid consist of? Can you send me a sample reproducing this behavior?
Looking forward to your reply.
Hi Milko,
Thanks for your response!
I am much surprised and puzzled by this logic. I do not see any issue with how the data are rendered by related UIElement objects. I do not understand those UIElement objects are not reused. When the data shown in a grid needs refreshing, why are the grid column header UIElement objects needed to be recreated or refreshed? Each time when I did grid row navigation by clicking on up or down scrollbar arrow, I saw grid column header UIElement objects were recreated.
We have grids with thousands of visible cells (5,000 easily); and the data source could have tens or hundreds of thousands rows and possibly hundreds columns. The data source get constant updates (multiple times per second). I estimate at lease 50,000 UIElement objects created and garbage collected each second, which will definitely affect the grid performance, both data rendering and navigation.
Any suggestion is greatly appreciated!
Did you try to change the call to Refresh method of the Rows collection in your application? What the result of this was?
Can you also try to create a small sample reproducing this behavior? And please let me know what is the performance issue you are facing? Is this flickering? Is grid repainting too slow – for several seconds or event for a couple of minutes?
Looking forward to your reply as well as for a sample reproducing this behavior.
Thanks so much for your response!
Your suggestion can only suppress firing event InitializeRow. I am looking for ways to reuse the UIElements within the grid.
Let me give you some background. Currently, we use a third party grid control which have been working well for our applications. But our company decided not renew contract from that third party .Net library company. We are in the process of finding a replacement and selecting a grid control of good performance for large amount data. I have some success with UltraGrid but the grid performance is not to our satisfaction. There are two issues I need to resolve for now:
1. Navigation delay both by pressing keys and clicking on scroll bars.
2. Column header tooltips are not shown up during rapid data refreshing because column header UIElements are constantly recreated.
If you want to see what UIElements are constantly recreated during data refreshing, you can use a creation filter. I am sorry I am not able give you a sample.
I have investigated your second issue, about the tooltips, and I have asked our engineering staff to examine “Constantly updating the cells value prevents column headers tooltips from appearing” further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of #220474. So I’ve created a case for you CAS-174017-R0J1D8 and will update you for the progress of this issue via the mentioned case. You could reach your case following the link below:
https://es.infragistics.com/my-account/support-activity
Any update on this issue?
Best Regards,Shaolin
These are the two issues you reported:
Please send us a sample reproducing your first issue. Looking forward to your reply.
Hi,
What happened to “Constantly updating the cells value prevents column headers tooltips from appearing”, Development ID of #220474? I reported this issue a year ago and it seems nothing has been done.
The second issue I reported has been fixed. However, all the objects are still recreated, which really affects grid performance. I was hoping the root cause would have been addressed.
The fix for development issue 220474 is available in the latest service release available from the My Keys and Downloads page.
I've updated your ticked.