The project that I'm working on requires me to display items in a grid which may have to appear in multiple groups. So for example, I may have a book that belongs to two Category groups, Books group and Navigation Books Group (it's a sub category of Books), and also to two Regions groups, USA group and a Canada group. Sometimes the grid may be grouped by both Category and Region, sometimes only one, and other times no grouping.
Right now I am basically creating four different views that contain the information I need for the grid and storing each into a separate ObservableCollection that I can switch to. When the user groups by Category I then switch the itemsource to the ObservableCollection that contains the correct duplicates of the items so that they appear once in each of the corresponding groups.
I'm assuming that the gridview was not built to handle this sort of use case, but is what I'm doing the best way of handling the display of the items. I don't want to have duplicates in the same group at any given time and I haven't been able to come up with a better performing way. The number of unique items in my largest collection can be up to 40,000 items with 18 Properties each, but only 8 columns visible and 2 hidden.
My problem is that creating the collections can be very time consuming and I'm only doing this for 2 grids right now, while in the future I might need to keep a set of collections in memory for up to 8 grids (only 1 would be really big). If one of the original sources of the view is updated I would then have to recreate the ObservableCollection (expensive operation).
Do you have any tips for this kind of gridview usage?
Right now I am basically creating four different views that contain the information I need for the grid and storing each into a separate ObservableCollection that I can switch to. When the user groups by Category I then switch the itemsource to the ObservableCollection that contains the correct duplicates of the items so that they appear once in each of the corresponding groups.
I'm assuming that the gridview was not built to handle this sort of use case, but is what I'm doing the best way of handling the display of the items. I don't want to have duplicates in the same group at any given time and I haven't been able to come up with a better performing way. The number of unique items in my largest collection can be up to 40,000 items with 18 Properties each, but only 8 columns visible and 2 hidden.
My problem is that creating the collections can be very time consuming and I'm only doing this for 2 grids right now, while in the future I might need to keep a set of collections in memory for up to 8 grids (only 1 would be really big). If one of the original sources of the view is updated I would then have to recreate the ObservableCollection (expensive operation).
Do you have any tips for this kind of gridview usage?