Click here to Skip to main content
15,031,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to know if its possible and how to go about it, I have a listview with checkboxes and depending on which item i check in the listview I would like it to also change the checkstate value in the other listview


I am not sure if i have worded this in a way that sounds logical but simply I want to synchronize one listviews checkbox with another so when i check a box in one listview it will do the same in the other

thank you in advance


would it be something like this?

VB
For Each lstitem As ListViewItem In ListView1.Items
                If lstitem.Checked = True Then
                    For Each lstitem1 As ListViewItem In listview2.items
                        lstitem1.Checked = True
                    Next
                End If
            Next
Posted
Updated 13-Nov-13 7:43am
v2
Comments
Sergey Alexandrovich Kryukov 13-Nov-13 13:32pm
   
Don't think it looks redundant and you should rather review your design?
—SA
Draco2013 13-Nov-13 13:39pm
   
is it possible?.. also it would not be redundant because of the way it works. I am looking to have other values selected or checked based upon the users selection. How can one do this?
martene 26-Nov-13 23:28pm
   
use the listview.itemchecked event and in the event handler iterate through the listview.checkeditems collection and based on weather the item is checked or not check the anotherlistview.item(index).checked=true

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900