English 中文(简体)
asp: Radiobutton List inside a repeater
原标题:

I am trying to bind a radiobutton list inside a repeater.

So for example my output will be :

Group1
Group1
Group1

Group2
Group2
Group2

Group3
Group3
Group3

I need the user to be able to select only 1 item from Each group, so in total 3 items should be selected.

<asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>                    
                <asp:RadioButtonList runat="server"  DataSource="<%# ((Outlet)Container.DataItem).OutletInformations %>" DataValueField="DateOfDelivery" DataTextField="DateOfDelivery" />
            </ItemTemplate>
        </asp:Repeater>

When the HTML renders out the page I have 3 groups as mentioned which is perfect but my selection is not working at all, as soon as I select 1 item from each group I cannot change my selection anymore, any help would be appreciated !

问题回答

As i know you can not do that simply as this because Group attribute will be generate like clientID.

But hear you can find a solution http://www.codeproject.com/KB/webforms/How_group_RButtons.aspx





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签