how to add discount column in gridview c# windows application
decimal Qty = Convert.ToDecimal(txtqty.Text);
decimal Unit_Price = Convert.ToDecimal(qtytxtprice.Text);
decimal Tax = Convert.ToDecimal(txttax.SelectedValue);
decimal Amount = (Qty * Unit_Price);
decimal PercentageAmount = ((Amount * Tax) / 100);
decimal TotalAmount = Amount + PercentageAmount;
public void CalculateTotalAmount()
{
decimal taxtotal=0;
decimal totalamount=0;
for(int i=0;i
{
decimal TotalAmount = (Convert.ToDecimal(dataGridView.Rows[i].Cells[4].Value) * Convert.ToDecimal(dataGridView.Rows[i].Cells[6].Value));
taxtotal = taxtotal + ((Convert.ToDecimal(dataGridView.Rows[i].Cells[7].Value)*TotalAmount)/100); totalamount=totalamount+ TotalAmount;
}
TotalTaxtxt.Text=taxtotal.ToString();
totalamounttxt.Text=totalamount.ToString();
_subTotal = taxtotal + totalamount;
txtNewTotal.Text = (_subTotal).ToString();
Subtxt.Text = (_subTotal).ToString();
CalcDiscountShopCost();
}
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rafnas T PPosted Jun 30, 2017, 8:45 AM
Rajkiran SwainPosted Jun 10, 2017, 12:55 PM
Karthi KeyanPosted Jun 10, 2017, 7:53 AM