Insert data from Detail To Header

how to update data from detail table to header table

order_datail (detail table)
order (table header)

i want insert / update sum total details to Total header

please help I newbe in ASP.NET maker

Read help file → Server Events and Client Scripts → Grid_Inserting / _Inserted / _Updating / _Updated.

Please help me
I write it like this

var mpnew = GetGridFormValues(); // Get the form values of the new records as as List<Dictionary<string, string>>
int newtotal = mpnew.Total(Convert.ToInt32(row[“total_mpd”])); // Loop through the new records and get the total
rsnew[“total_mph”] = newtotal;

Note :
header tabel : fcr_header
detail tabel : fcr_detail

rsnew[“total_mph”] : is field in the table header that I want to change with data from the table details [“total_mpd”]
[“total_mpd”] = : is fie;d in detail table ( multi record ) that iwan to insert the total all record [“total_mpd”] to rsnew[“total_mph”] ( header tabel )

and the error like this :
Models\fcr_headerinfo.cs(2841,19): error CS0103: The name ‘GetGridFormValues’ does not exist in the current context [D:\NET\develop\appfcr\script\appfcr.csproj]
Models\fcr_headerinfo.cs(2844,50): error CS0103: The name ‘row’ does not exist in the current context [D:\NET\develop\appfcr\script\appfcr.csproj]
Error: Failed to publish project.