Getting the total of the values in a column in a datagrid.
Posted: Mon Jun 12, 2023 10:31 am
Hi,
I have a datagrid table to show the contents of an invoice. Each row - item, price, quantity, total, comprises the sales detail of a product. There may be several different products on the invoice, so several rows. My problem is, I want to add the total of the totals in the last column to present a grand total.
It occurs to me that I could do the addition, row by row, outside the dg, adding each total to an outside field then entering the field back into the DG, but one of you guys might know a more elegant way to do it, a single (simple) line of code perhaps ? Hope I've explained it properly. Looking forward to hearing from you..
I have a datagrid table to show the contents of an invoice. Each row - item, price, quantity, total, comprises the sales detail of a product. There may be several different products on the invoice, so several rows. My problem is, I want to add the total of the totals in the last column to present a grand total.
It occurs to me that I could do the addition, row by row, outside the dg, adding each total to an outside field then entering the field back into the DG, but one of you guys might know a more elegant way to do it, a single (simple) line of code perhaps ? Hope I've explained it properly. Looking forward to hearing from you..