waheedrafiq
Member
- Joined
- Jan 4, 2015
- Messages
- 11
- Programming Experience
- 1-3
Hi all
I have done 5 hours of research today and have found this link on cSharpforums.net http://www.csharpforums.net/windows-forms/1145-fill-listview-arraylist-text-file.html
a bit confused if I should be using Arraylist or not.
I need some advice on my logical thinking here.
I have a dataGrid that reads from sql database , I want user to select a item that has a price and I just want to add that price to subtotal until the user decided to stop shopping.
here is my code example it works but only once , I need something that would loop until user doesn't select anything
I hope the above makes sense
I need some serious advice any support would be appreciated
I have done 5 hours of research today and have found this link on cSharpforums.net http://www.csharpforums.net/windows-forms/1145-fill-listview-arraylist-text-file.html
a bit confused if I should be using Arraylist or not.
I need some advice on my logical thinking here.
I have a dataGrid that reads from sql database , I want user to select a item that has a price and I just want to add that price to subtotal until the user decided to stop shopping.
here is my code example it works but only once , I need something that would loop until user doesn't select anything
private void txtAddToInvoice_Click(object sender, EventArgs e) { // Select the value from table that user has selected product DataGridViewRow dr = tbl_ProductDetailsDataGridView.SelectedRows[0]; string UnitPriceS; // String value int Quantity; decimal total; decimal subTotal; ArrayList SubtotalList = new ArrayList(); btnGenerateInvoice.Enabled = true; // storing the value that user has click to UnitPrices UnitPriceS = dr.Cells[3].Value.ToString(); decimal UnitPrice = Math.Round(Convert.ToDecimal(UnitPriceS), 2); Quantity = Convert.ToInt32(txtQuantity.Text); total = UnitPrice * Quantity; SubtotalList.Add(total); // count array int count = SubtotalList.Count; listBox1.Items.Add(count); MessageBox.Show(count.ToString()); }
I hope the above makes sense
I need some serious advice any support would be appreciated
Last edited by a moderator: