|
-
Apr 2nd, 2007, 07:53 AM
#1
Thread Starter
Addicted Member
listview checkboxes not working
I have a listview with checkboxes, when I loop thru it, it always says that all of the items are checked, but they aren't, I step thru it to verify.
For Each lstItem In lsvStations.Items
If lstItem.Checked Then
QString = QString & lstItem.Text & ","
End If
Next lstItem
WHat is wrong,,
THanks for help
-
Apr 2nd, 2007, 07:54 AM
#2
Thread Starter
Addicted Member
Re: listview checkboxes not working
One more thing, in case it matters, this is in VB.NET
-
Apr 2nd, 2007, 08:08 AM
#3
Re: listview checkboxes not working
 Originally Posted by DebbieInFlorida
One more thing, in case it matters, this is in VB.NET
It does.
Moved.
It also matters what version of VB.NET. Are you using 2005?
-
Apr 2nd, 2007, 12:24 PM
#4
Thread Starter
Addicted Member
Re: listview checkboxes not working
thanks for moving me, old habits are hard to break.. I am using VS 2005
-
Apr 2nd, 2007, 12:30 PM
#5
Re: listview checkboxes not working
in .NET you can access a collection of ONLY the checked listviewitems from the listview...
vb Code:
'LOOP CHECKED ITEMS
For Each lstItem In lsvStations.CheckedItems
'ADD ITEM TEXT TO STRING
QString &= lstItem.Text & ","
Next
'TRIM TRAILING "," FROM END OF QString
QString = QString.TrimEnd(","c)
-
Apr 2nd, 2007, 09:16 PM
#6
Thread Starter
Addicted Member
Re: listview checkboxes not working
Thanks Klein,
That looks so obvious. I didn't realize there were so many changes with .NET, have only been in it for a month, but I really like it.
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|