Does anyone know of a way to inject rows into a Silverlight DataGrid? I need a way to add totals rows after every 6 entries. The totals are for all rows above the summary row, not just the previous six.
I’ve tried doing it with grouping but that only shows the totals for the group and displays the totals rows above the actual rows. I would prefer to use a DataGrid for this if possible, but all solutions are welcome.
Okay, I have a solution for you; however, it contains some funky math kung fu and so I am not sure whether it is the best solution. It does, however, work with a DataGrid.
Itemsis an ObservableCollection andInfois just a test class I created. I did comment the code quite thoroughly. It is more generic than your requirement in the sense that you can change thenumRowsToSumto any value and it should still work.