Wednesday 16 January 2013

Select/Deselect all listbox items by checkbox

Simple code for executing this is

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{

foreach (ListItem item in ListBox1.Items)   {
item.Selected = CheckBox1.Checked;
   }
}

No comments:

Post a Comment