I have a WPF DataGrid which is displaying data sets with more than 60 columns and anything up to 10000s of rows. The DataGrid loads the complete datasets very quickly and handles them well.
colA colB colC colD colE ...
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
However the rows are split into groups. I need to display a group header that is a text string and to be able to expand/collapse the groups.
I can use grouping for the DataGrid which looks fine but is incredibly slow to initially display large groups.
colA colB colC colD colE ...
^ group title A
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
^ group title B
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
I can do the grouping myself externally to the DataGrid by adding an extra column with the group description in it. I can then collapse/expand any groups by changing the dataset provided to the grid. That is very fast, but it looks rubbish as it wastes a lot of space especially with long group titles.
group colA colB colC colD colE ...
group title A
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
group title B
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
What I want is the best of both worlds i.e. fast and pretty, to be able to display the data as if the DataGrid was grouping, but to do the grouping externally.
colA colB colC colD colE ...
^ Very long comment about the data ...
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
^ Another arbitrarily long comment...
1 2 3 4 5
5 6 7 8 9
2 3 4 3 4
Any idea how I can display my group headers that way?