Grouping radio buttons inside a repeater..

Aug 18 2010 5:18 PM
Hi,

I wanted to group radio buttons (not radiobuttonlist) inside a repeater?

Is it possible to assign the groupnames for each radiobutton dynamically?

I'm running into the exact same problem with my web programming, but my situation is a little different.


I have 3 radiobutton tags in my aspx code (without the groupname tag assigned), and I change their visibility from false to true during run-time. I'm trying to group them by adding identical group names to the radiobuttons during run-time, but it's not working.

I tried confirming the values of each of the groupnames by displaying them on the webapplication, and each set of radiobuttons do show the same groupname. It's just that they, in reality, aren't grouped together because I can still select each radiobutton individually. 

If anyone knows what's going on, any help would be greatly appreciated. I'm quite puzzled by this. 

<asp:radiobutton id = "prid" runat = "server" autopostback = "true"/>

RadioButton rbsqlst = ctrl as RadioButton;
string qparentid = DrvSubQList["QParentid"].ToString(); this is the same value for all the radiobuttos
rbsqlst.GroupName = qparentid;


Thanks in advance!