How to add multiple footer from code behind
total2 = Convert.ToDecimal(Session["total"].ToString()) + Convert.ToDecimal(total.Text.ToString());
dt.Rows.Add(product.SelectedItem.ToString(), qty.Text.ToString(), price.Text.ToString(), total.Text.ToString());
qty.Text = "0";
price.Text = "0";
total.Text = "0";
cgst.Text = "0";
sgst.Text = "0";
product.SelectedIndex = product.Items.IndexOf(product.Items.FindByText("select"));
Session["dtInSession"] = dt;
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.FooterRow.Cells[2].Text = "Grand Total(Rs.)";
GridView1.FooterRow.Cells[3].Text = total2.ToString();
Session["total"] = total2.ToString();
}
}
private void gridVIEWData()
{
dt.Columns.AddRange(new DataColumn[4] {
new DataColumn("Product Name"),
new DataColumn("Quantity"),
new DataColumn("Price(Rs.)"),
new DataColumn("Total Price(Rs.)")
});
Session["dtInSession"] = dt;
}