By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

how do i get a summary row for a total of all the products sold in datagridview?

P: 3
Dim Inventory() As String = IO.File.ReadAllLines("inventory.txt")

Dim query = From line In Inventory
Let data = line.Split(","c)
Let name = data(0)
Let cost = FormatCurrency(data(1))
Let quantitysold = data(2)
Let EndInv = 45 - data(2)
Let totalCostperproduct = FormatCurrency(data(1) * data(2))
Select name, cost, quantitysold, EndInv, totalCostperproduct

dgvInventory.DataSource = query.ToList
dgvInventory.CurrentCell = Nothing
dgvInventory.Columns("name").HeaderText = "Product Name"
dgvInventory.Columns("cost").HeaderText = "Bin Cost"
dgvInventory.Columns("quantitysold").HeaderText = "Items Sold"
dgvInventory.Columns("EndInv").HeaderText = "Ending Inventory"
dgvInventory.Columns("totalCostperproduct").Header Text = "Total Cost per Item"
Mar 27 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.