Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to clear the checkboxlist checked items after save buttonclick event in c#
Posted

Rebind is an option, but I would not suggest it. Instead, just do:
C#
foreach (ListItem item in lstMultipleValues.Items)
{
//check anything out here
if (item.Selected)
  item.Selected= false;
}
 
Share this answer
 
Hi,

Add the following lines in your button_Click event:

C#
int count = CheckBoxList1.Items.Count;
        for (int i = 0; i < count; i++)
        {
            if (CheckBoxList1.Items[i].Selected == true)
            {
                CheckBoxList1.Items[i].Selected = false;
            }
        }


thank you
 
Share this answer
 
Try this ..

chkList.ClearSelection();
 
Share this answer
 
rebind checkboxlist after save
 
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