Dim Inventory As New Collections.Generic.List(Of itemstochange)
'Loaded Inventory in the next few lines, left out to keep the question shorter
'I've looped through Inventory and it does fill correctly
'Inventory has three properties, sku, description & price
Dim source As New BindingSource
source.DataSource = Inventory
DataGridView1.DataSource = source
'Originally used Generic List
'Dim Inventory As New Collections.Generic.List(Of itemstochange)
'using BindingList instead of Generic List...
Dim Inventory As New BindingList(Of itemstochange)
'To add something to your list will be
Dim t As Integer
Dim theSku As String = ""
Dim theDesc As String = ""
Dim thePrice As Double = 0
Dim f1 As Integer = 0
ProgressBar1.Maximum = lastSku
ProgressBar1.Value = x
For t = x To lastSku
'Grab Items from excel worksheet, put into BindingList
If Len(xlWorkSheet.Cells(t, y).value) > 0 Then
theSku = xlWorkSheet.Cells(t, y).Value.ToString
Else
f1 = 1
End If
If Len(xlWorkSheet.Cells(t, (y + 1)).value) > 0 Then
theDesc = xlWorkSheet.Cells(t, (y + 1)).Value.ToString
Else
f1 = 1
End If
If Len(xlWorkSheet.Cells(t, (y + 6)).value) > 0 Then
thePrice = CDbl(xlWorkSheet.Cells(t, (y + 6)).Value.ToString)
Else
f1 = 1
End If
If f1 <> 1 Then
'Add to Binding List
Inventory.Add(New itemstochange(theSku, theDesc, thePrice))
Else
f1 = 0
End If
ProgressBar1.Value = t
Application.DoEvents()
Next
'Connect BindingSource to Binding list
BindingSource1.DataSource = Inventory
'Connect DataGridView to Binding Source
DataGridView1.DataSource = BindingSource1