You can add a last_row key to the dictionaries and set it to 1 on the last row. Then you can setup the row template form so it either:
- hides or shows columns depending on the value of
last_row - contains two containers, one for the normal rows and one for the totals row, and show one container or the other.
An alternative, valid if you don’t need any fancy formatting, is to use the DataGridJson, which manages the total row for you.
PS
Please format your code so it’s easier to read: How to ask a good question