Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
hii

i have a CheckBoxList and a link button, if i press link button i want to check all items in the CheckBoxList

Thank you
Regards
Mahesh chayanam
Posted

On your link button click event write this code...

C#
foreach(ListItem item in chkList.Items) 
    item.Selected = true;
 
Share this answer
 
you can use this :
C#
for (int i = 0; i < checkedlistbox.Items.Count; i++)
{
   checkedlistbox.SetItemChecked(i, true);
}



Thanks,
Ambesha
 
Share this answer
 
v2

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