TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jyoti Jodha
NA
1.7k
407k
how to add discount column in gridview c# windows form
Jun 10 2017 4:15 AM
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();
}
Reply
Answers (
3
)
Open Default browser and target an element
How to add Appendix in table of contents in word using VSTO.