Access to "Select All"-ListboxItem

Jun 21, 2011 at 4:02 PM


this control is great work so far. It helped me a lot fot my application.

There are two questions:

How can I set the "Select All" entry to checked or unchecked in the programcode?

How can I determine wether "Select All" is checked or not?




Jun 22, 2011 at 7:04 AM
Edited Jun 22, 2011 at 8:45 AM

'Select all' is a virtual node which doesn't have any item you can access on server side or some dedicated client side API. The value of the node is evalutaed depending on the selection of other check boxes i.e. it can't be set directly. If you want this value selected you may either go through all elements of the collection DropDownCheckBoxes.Items and set ListItem.Selected = true (server side). Or use jQuery to set checked value of all check boxes within element with the id == DropDownCheckBoxes.ClientID (client side).

Determinig whether 'Select All' is checked or not is the same concept: you need to go through all check boxes checking if all of them are checked - you still need to iterate either server or client side.