Step 1: Declare a page scope variable
double dbltotal=0;
Step 2: In GridView1_RowDataBound event, find the price and quantity field. then
if (e.Row.RowType == DataControlRowType.DataRow)
{
double price = (write code to find price column);
double quantity=(write code to find quantity column);
dbltotal+=(Convert.ToDouble(price)*Convert.ToDouble(quantity));
}
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[Your Column Number where you want to show Grand Total].Text = dbltotal;
}
I have used this same logic but i am not getting the desired result