I am creating a listview with a collections of ListViewItems, all with checkboxes. I want to check wich Item is checked. I know how to launch the ItemChecked event but the event is launched every time an ListViewItem is added to the ListView. How can I prevent this?
To help you understand what I want to do, here is a little info about the application.
I am building a application for Red Cross dispatchers. It will help them keep track of the units in the field. The application is used to, among other things, log the transmissions. When during a transmission a priorety transmission comes in, the current unit will be set on hold. This will be done by checking the checkbox belonging to the units ListViewItem.
By checking the checkbox, the object (with the type Unit) will set the property objUnit.onHold to true. When the checkbox is unchecked the property will be set to false again. Every 3 minutes the application will loop through all units to see if anyone is still on hold. If so, a messagebox will popup reminding the dispatcher of the unit on hold.
So you see, I have to be sure that the dispatcher really checked or unchecked the ListViewItem.
I hope someone can point me in the right direction.
You can set a flag indicating that you are inserting an item and ignore the event if the flag is checked.