Link to home
Start Free TrialLog in
Avatar of praveenuni
praveenuni

asked on

Dynamic CheckBoxes

Hello,

I 'm creating checkboxes dynamically like this:

foreach (string Name in this.NameList)
{
CheckBox oCheckBox = new CheckBox();
oCheckBox.Text = Name;
oCheckBox.AutoPostBack = true;
oCheckBox.CheckedChanged +=new EventHandler(oCheckBox_CheckedChanged);
this.LayersPanel.Controls.Add(oCheckBox);
}

This will create checkboxes list = count of names in the arraylist.
Problem: If I select first checkbox, it should automatically select all other checkboxes in the list. But not the same case if I select any other checkbox. How can I do this?
SOLUTION
Avatar of Yurich
Yurich
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial