sbornstein2
asked on
ASP.Net/C# - Is there a way to make a group of checkboxes mutually exclusive?
Hi all. This is not an easy one I beleive. I am creating radiobuttons currently with a groupname all in code dynamically. Well the user now needs to be able to deselect one. I know I could create one more control with "none" as an option. Is there a way though to create checkboxes that will do this? Through my loop I create controls such as this in a control array and you can see I dynamically create its ID as well:
cbl.ID = "cbl" + count; //i.e. ID = rbl1_23
cbl.Attributes.Add("Price" , formattedPriceControl);
cbl.Attributes.Add("ItemID ", row["ItemID"].ToString());
myControls.Add(cbl.ID);
lit.Text = sbAddBookItems.ToString();
this.Form1.Controls.Add(li t);
this.Form1.Controls.Add(cb l);
cbl = new CheckBox(); //reset the CheckBoxList to a new one
lit = new Literal();
cbl.ID = "cbl" + count; //i.e. ID = rbl1_23
cbl.Attributes.Add("Price"
cbl.Attributes.Add("ItemID
myControls.Add(cbl.ID);
lit.Text = sbAddBookItems.ToString();
this.Form1.Controls.Add(li
this.Form1.Controls.Add(cb
cbl = new CheckBox(); //reset the CheckBoxList to a new one
lit = new Literal();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My suggestion would be to use Javascript to accomplish your task. Is this an option?