Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
how to add discount column in gridview c# windows form
Jyoti Jodha
Jun 10 2017 4:15 AM
244
Reply
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<dataGridView.Rows.Count;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();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Open Default browser and target an element
How to add Appendix in table of contents in word using VSTO.