Hi,
I have two data sets that i want to quickly switch back and forth on the grid. Both the datasets are type observablecollection and the column order, style are the same, so i want to recycle the cells, at present when i switch between the two ItemSources I see that all the cells are re-created and this takes up a few seconds. As the user of my app would do this multiple times in a day the slight pause looks very annoying to them.
Is there a way or a property that I can use so the grid could recycle the cells instead of creating all cells from scratch when the underlying source is switched?
Thanks,
Rohit
Thanks a bunch Konstantin, this was the perfect solution. Cheers.
Hi Rohit,
I think I have a workaround for you - assuming that the items in the different data sets are of the same type.
You need to create a wrapper class implementing IEnumerable<T>, INotifyCollectionChanged which will wrap your data sets and will make the switch between different data sources to look like a CollectionChanged(Reset) to the xamGrid.
You could check out the attached sample for the actual implementation. I've verified that no new CellControls are created during the switch of the data sets.
Hope this helps.