ASP.NET c# - RadioButtons not grouped -
i have gridview , in onrowdatabound callback adding new cell , cell i'm adding radiobutton. i've set groupname on radio button, can still select more 1 button @ time.
how can make them grouped 1 radio button can selected within group.
edit - code:
// add radio button select if purchased address // set the home address of contact e.row.cells.addat(0, new tablecell()); radiobutton rbsetaddress = new radiobutton(); rbsetaddress.id = "rdsetaddress" + e.row.cells[2].text; rbsetaddress.groupname = "setaddress"; e.row.cells[0].controls.add(rbsetaddress);
so i'm setting unique id , same groupname. asp.net not setting name attribute of input groupname. can select many radio buttons want. not want happen. want able select 1 , 1 in group identified groupname.
http://www.codeproject.com/kb/webforms/how_group_rbuttons.aspx
basically, when in repeater of kind (which gridview is), names no longer same group property result of way asp.net names things inside repeater (essentially each control gets prefix make unique).
Comments
Post a Comment