Sheritlw
asked on
Loop Through ListView Items/Columns
I am very new to .Net, and don't know how to loop through a listview and get it's values so that I can save in a database.
I fill the listview dynamically using...
With lst
str(0) = CStr(iWatch1)
str(1) = sTime
itm = New ListViewItem(str)
lst.Items.Add(itm)
End With
Now I need to get the str(0) value and str(1) value to save
For i = 0 to lst.items.count - 1
How do I get the values for each column???
next
Thanks
I fill the listview dynamically using...
With lst
str(0) = CStr(iWatch1)
str(1) = sTime
itm = New ListViewItem(str)
lst.Items.Add(itm)
End With
Now I need to get the str(0) value and str(1) value to save
For i = 0 to lst.items.count - 1
How do I get the values for each column???
next
Thanks
ASKER
Unfortuntly when I click or transfer links my IE crashes.
I know I have a lot to learn about .Net. I spent the last 15 + years programming with VB and before that with Cobol.
This app is for my sister and she needs it right away. I figured I would develop it enough so she could use it and then rework it as I learn net.
I really just wanted an example of looping through a listview.
Thanks
I know I have a lot to learn about .Net. I spent the last 15 + years programming with VB and before that with Cobol.
This app is for my sister and she needs it right away. I figured I would develop it enough so she could use it and then rework it as I learn net.
I really just wanted an example of looping through a listview.
Thanks
Try this...
For i = 0 to lst.items.count - 1
msgbox(lst.item(i).Subitems(0).value)
msgbox(lst.item(i).Subitems(1).value)
next
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Unfortunely item is not an option for the list. Items is...
I filled it using a listviewitem
With lst
str(0) = CStr(iWatch1)
str(1) = sTime
itm = New ListViewItem(str)
lst.Items.Add(itm)
End With
Trying to figure out how to get the information out.
Thanks
I filled it using a listviewitem
With lst
str(0) = CStr(iWatch1)
str(1) = sTime
itm = New ListViewItem(str)
lst.Items.Add(itm)
End With
Trying to figure out how to get the information out.
Thanks
For i = 0 to lst.items.count - 1
msgbox(lst.items(i).Subite
msgbox(lst.items(i).Subite
next
http://windowsclient.net/learn/video.aspx?v=12389
http://windowsclient.net/learn/video.aspx?v=12390