We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ListView after ItemCheck

Hi, I am using the ListView with check boxes and wish to change the state of a button depending on whether there are any items checked in list or not. I have tried evaluating the ListView.CheckedItems.Count value in the ItemCheck event but unfortunatley the value is not updated at this point, and there is not an AfterItemChecked event. Does anyone know how I can evaluate this immediately an item is checked or unchecked ?

1 Reply

EM Emma February 4, 2004 06:36 AM

> Hi, > > I am using the ListView with check boxes and wish to change the state of a button depending on whether there are any items checked in list or not. I have tried evaluating the ListView.CheckedItems.Count value in the ItemCheck event but unfortunatley the value is not updated at this point, and there is not an AfterItemChecked event. Does anyone know how I can evaluate this immediately an item is checked or unchecked ? > Hi Ian ItemCheck is fired for each item, even in a multiselection, which for you purposes is quite handy. The eventargs gives you NewValue, which will be true id the item is in the prcess of being checked. So if you take ListView.CheckedItems.Count+1, that will give you an accurate value. Hope this helps! Cheers Em

Loader.
Live Chat Icon For mobile
Up arrow icon