Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hhi to all...

i have listitems in listview with checkboxes and set property checkboxes checked =true and when i run that listview that time shows all listitems with checked but now i unchecked some listitems. when i unchecked some lstitems i want to strore that check staus..how ? in which event we have to strore..

when again run that listview that time shows unchecked items also..
how is it possible ..
pls let me know..
Posted

1 solution

Use the listView1_ItemCheck() event of the ListView control and write the following code.
Now you can find easily which checkbox is checked which is not.

C#
private void listView1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            ListViewItem l = listView1.Items[e.Index];
            if (e.NewValue == CheckState.Checked)
            {
                MessageBox.Show(l.ToString() + "  is checked.");

            }
            else
            {
                MessageBox.Show(l.ToString() + "  is UNchecked.");
            }
        }
 
Share this answer
 

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