Solved

give groupname of radio button inside repeter

Posted on 2012-03-13
1
321 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.NET tools for adding thread safety to a web app? 3 33
Delete HTML table rows 12 29
Checkbox in a dynamic GridVIew is not clickable? 5 26
Deploying to Azure 3 28
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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