Add row data bound event
protected void gdv1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblcost = (Label)e.Row.FindControl("lblcost");
int cost = Convert.ToInt16(lblcost.Text);
TextBox txtquantity = (TextBox)e.Row.FindControl("txtquantity");
int quant = Convert.ToInt16(txtquantity.Text);
int Prize = cost * quant;
Label lbTotal = (Label)e.Row.FindControl("lbTotal");
lbTotal.Text = Prize.ToString();
}
}