I read the article on adding a checkbox to a listview and it works great. Does anyone know how to change the checked value in code? For example: If I wanted to default all listitems to have a checked status.
Printable View
I read the article on adding a checkbox to a listview and it works great. Does anyone know how to change the checked value in code? For example: If I wanted to default all listitems to have a checked status.
Will this work for you?
Dim cnt As Integer
ListView1.Checkboxes = True
For cnt = 1 To ListView1.ListItems.Count
ListView1.ListItems.Item(cnt).Checked = True
Next
That would work just fine if there was a property called Checked, but ListView1.ListItems.Item(cnt).Checked does not exist as a property. The above example is exactly how I would like to use it though.Quote:
Will this work for you?
Dim cnt As Integer
ListView1.Checkboxes = True
For cnt = 1 To ListView1.ListItems.Count
ListView1.ListItems.Item(cnt).Checked = True
Next
Any other suggestions?