Hello,
I have a grid view that bind data from other grid view (from other page) and I want the user to be able to insert quantity and then to calculate the total price.
how can I do that?
i've tried this example:
http://www.c-sharpcorner.com/blogs/7857/calculate-total-price-on-textbox-change-event.aspx
and its great but missing the grand total. how can I calculate the grand total and display it both on grid view and label?
thanks!
sPosted Sep 4, 2012, 9:53 AM
I want to calculate the total of all the totals..
my code is:
and I have this JS:
how can I add to this code the calculation of total amount?
Dorababu MekaPosted Sep 4, 2012, 9:22 AM
In page load after your grid bind add this
for (int i = 0; i < grdInvoice.Rows.Count; i++)
{
TextBox curTexbox = grdInvoice.Rows[i].Cells[1].FindControl("txtQuantity") as TextBox;
TextBox curTexbox1 = grdInvoice.Rows[i].Cells[3].FindControl("txtRate") as TextBox;
TextBox curTexbox2 = grdInvoice.Rows[i].Cells[4].FindControl("txtAmount") as TextBox;
curTexbox.Attributes.Add("onBlur", "return multiplication('" + curTexbox.ClientID + "','" + curTexbox1.ClientID + "','" + curTexbox2.ClientID + "')");
}
Rename with your controls here
This will work when you are trying to add or edit the quantity or Rate value
sPosted Sep 4, 2012, 9:12 AM
Dorababu MekaPosted Sep 4, 2012, 9:05 AM
http://dotnetspeaks.net/post/Display-Total-in-GridView-Footer-using-JQuery.aspx