Hello,
I am trying to create 3 radio buttons inside the repeater control for 3 possible options where each option has 3 radio button to choose from using following syntax:
<asp:Repeater ID="rptrRoles" runat="server" OnItemDataBound="rptrRoles_ItemDataBound" > <ItemTemplate><asp:RadioButton ID="" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>' GroupName="SiteRoles" /><br />
<asp:TextBox ID="txtSID" runat="server" Visible="false" /> <asp:TextBox ID="txtRoleID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RoleID") %>' Visible="false" /> ItemTemplate> asp:Repeater>But, I am having this isue that user can select all the radio buttons for the options at the same time. However, I only want the user to select only 1 radio button for each option.
Please help.
Thanks in advance for all your help.
karen mokPosted Jul 20, 2009, 3:21 PM
If anyone would be able to share some of their insight into this problem, that would be greatly appreciated.
Thanks again!
karen mokPosted Jul 19, 2009, 2:00 AM
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 the maximum of 3 radiobuttons shown in each repeater, but the number of radiobuttons to show per repeater varies.
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.
Thanks in advance!
Niradhip ChakrabortyPosted Jun 17, 2008, 3:17 AM
For that three radio button give same group name.
something like this: