Solved

give groupname of radio button inside repeter

Posted on 2012-03-13
1
322 Views
Last Modified: 2012-03-19
Hello Experts,
   i am facing some problem in giving group name of radio button that is inside repeter please provide me the solutions that how can i do that


Below is the sample code
 <asp:Repeater ID="Repeater1" runat="server">
                                                  <HeaderTemplate>
                                                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr>
                                                    <td width="4%">&nbsp;</td>
                                                    <td width="13%" class="workshop-text"><span class="bold">DATES</span></td>
                                                    <td width="11%" class="workshop-text"><span class="bold">CITY</span></td>
                                                    <td width="15%" class="workshop-text"><span class="bold">LANGUAGE</span></td>
                                                    <td width="30%" class="workshop-text"><span class="bold">VENUE (Click for details)</span></td>
                                                    <td width="27%" class="workshop-text"><span class="bold">FEES</span></td>
                                                  </tr>
                                                  </HeaderTemplate>
                                                    <ItemTemplate>
                                                  <tr>
                                                    <td colspan="6" height="7"></td>
                                                  </tr>
                                                  <tr>
                                                    <td>
                                                       <asp:RadioButton ID="rbworkshop" runat="server" GroupName="rbworkshop1" />
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lbldate1" runat="server" Text='<%#Eval("FromDate","{0:MMM-dd}")+" "+Eval("ToDate","{0:MMM-dd}") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lblcity" runat="server" Text='<%#Eval("city") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lbllanguage" runat="server" Text='<%#Eval("Language") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lblvenue" runat="server" Text='<%#Eval("Venue") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">Rs.
                                                    <asp:Label ID="lblfee" runat="server" Text='<%#Eval("Fees","{0:0.00}") %>'></asp:Label>
                                                    </td>
                                                  </tr>
                                                  </ItemTemplate>
                                                  <FooterTemplate>
                                                       <tr>
                                                            <td colspan="6" height="7"></td>
                                                       </tr>
                                                  </table>
                                                  </FooterTemplate>
                                                  </asp:Repeater>
0
Comment
Question by:dotsandcoms
1 Comment
 
LVL 22

Accepted Solution

by:
Mrunal earned 375 total points
ID: 37714740
GroupName property doesn't work as expected when used in a Repeater for radio buttons.

For server side controls (asp radio button) you have to do manually grouping.
I will suggest that instead of server side code, use simple html control. like this:

<input type="radio" name="rbworkshop" value='<%#Eval("CustomerNumber") %>' />

For postback, you can get the value from Request.Form("rbworkshop").

OR

for server side radio buttons, you have to manually set single radio button as selected by JavaScript function.

check this for more:

http://stackoverflow.com/questions/4030155/radio-button-list-in-repeater-control
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question