Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27379

Adding items of a listview to a collection

$
0
0
I was wondering if anyone knew how to add items to a collection that represents items in a listview?

If this helps, its the code that im using to add an item to the listview

j = 0
While j < i
Dim lvi As New ListViewItem
lvi.Text = ListOfData(j).ItemName
lvi.SubItems.AddRange(New String() {ListOfData(j).Availability, ListOfData(j).Category, ListOfData(j).Quantity.ToString, ListOfData(j).StockPrice, ListOfData(j).SalePrice, ListOfData(j).CurrentDate})
ListView1.Items.Add(lvi)
j += 1
End While

I've never used a collection before, sorry if this doesnt make sense!!
Basically I want to know how to add the items in the listview to a collection (ListOfLvItems) :)

Viewing all articles
Browse latest Browse all 27379

Latest Images

Trending Articles



Latest Images