calculate TOTAL and GRAND TOTAL in gridview

Posted by Parthibansk under ASP.NET on 1/24/2013 | Points: 10 | Views : 2519 | Status : [Member] | Replies : 0
GOT A TEXTBOX IN GRIDVIEW..
WHEN I UNPUT PRICE AND QUANTITY..TOTAL SHOULD BE DISP IMMED
FOLLWED BY GRANDTOTALL...

THIS IS DATABOUND CODE:

protected void gridview1_rowdatabound(object sender, GridViewRowEventArgs e)
{

if (e.Row.RowType == DataControlRowType.DataRow)
{

decimal price = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "price"));
decimal qunatity = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "quantity"));
// TextBox txtproductname = (TextBox)e.Row.FindControl("txtproductname");
TextBox Txtprice = (TextBox)e.Row.FindControl("txtprice");
TextBox txtquantity = (TextBox)e.Row.FindControl("txtquantity");

TXTTOTALPRICE.TEXT = Convert.ToString(Convert.ToDecimal(Txtprice.Text) * Convert.ToDecimal(txtquantity.Text));
//txtquantity.Attributes.Add("Onblur", "javascript:return CALCTOTAL();");
//(" + Txtprice.ClientID + ", '" + txtquantity.ClientID + "', '" + lbltotalprice.ClientID + "')");




}




Responses

(No response found.)

Login to post response