Hello Goodnight. How can I put de sum of the “Vendor # 2 Amount” column (grid) in the Total field ( Vendor # 2).
the result in the “Vendor #2” field should be: 180.
I need to update the total value (Vendor #2 field) for each record the user adds in the grid (the user does not necessarily have to save the record to reflect the update in the “Vendor #2” field) too.
Additional: is a master detail form
could someone help me please.
Best answer by eddiedaco
i solved it this way.
in the rowUpdated Event of the detail grid. i add the code that
@Naveen Bshared with me.
// use this code to get the current data of Master table
CEBidLeveling item = viewCEBidLeveling.Current;
//Calculate the sum of values from the column InternalTotalAmount (detailTable)
// viewCEBidLeveling is my detail table
decimal? Vendor1Total = this.viewCEBidLevelingItem.Select().FirstTableItems.ToList().Select(x => x.Vendor_1TotalAmount).Sum();
//put the value of the sum in Master table column (viewCEBidLeveling)
item.Vendor_1Total = Vendor1Total;
change the values of the columns (commit changes = true or AutoCallBack=true) that you want to trigger the changes (in my case the Vendor1_TotalAmount column) and that's it. When you enter real-time values, whether or not they are saved in the database, the column will be automatically recalculated.
thank you very much for your help. I hope my solution can help others.