Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi How to select All/Deselect All in checkbox list having dynamic item loaded.
and should be able to select single item if select all item is not checked
Posted

 
Share this answer
 
CheckBoxList control provides a method to clear selection from all items: ClearSelection[^]
On the other side there is no such method, but you can create one easily...
C#
for (int i=0; i < Items.Count; i++)
{
  Items[i].Selected = true;
}

(And this is the exact copy of the code from ClearSelection, except the 'true' bit...)
 
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