473,626 Members | 3,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RadioButton in DataList

Howdy,

Using ASP.NET 2.0 with VB. I have a datalist that is listing out options.
Ecah option has a radio button for which the user has to select only one
option from the list. It displays properly but it appears to be not working
properly. They can select all of the radiobuttons at once. Not very good!
How do I set it up so each radiobutton is part of the group? I'm using the
GroupName option but no luck. See my HTML below.

Thanks

David
<asp:DataList ID="dlOptions" runat="server">
<ItemTemplate >
<td>
<asp:RadioButto n ID="radOption" Text='<%#Eval(" Cost") %>'
runat="server" GroupName='<%# Eval("ShipTo")% /></td>
<td><asp:Labe l runat="server" ID="lblShipName "
Text='<%#Eval(" Name") & "-" & Eval("Desc")%>' ></asp:Label>
<asp:Label runat="server" ID="lblShipType " Text='<%#Eval(" Type")
%>'></asp:Label></td>
</ItemTemplate>
<SeparatorTempl ate>
<td>&nbsp;</td>
</SeparatorTempla te>
<FooterTemplate >
<td><img src="site_image s/spacer.gif" width="80" height="1"
/></td>
<td><img src="site_image s/spacer.gif" width="600" height="1"
/></td>
</FooterTemplate
Sep 19 '06 #1
1 2252
After doing some research and discovering its basically impossible, I just
lined up a RadioButtonList next to a datagrid so the options lined up and it
works great.

thanks,
David

"David Lozzi" <dl****@nospam. nospamwrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
Howdy,

Using ASP.NET 2.0 with VB. I have a datalist that is listing out options.
Ecah option has a radio button for which the user has to select only one
option from the list. It displays properly but it appears to be not
working properly. They can select all of the radiobuttons at once. Not
very good! How do I set it up so each radiobutton is part of the group?
I'm using the GroupName option but no luck. See my HTML below.

Thanks

David
<asp:DataList ID="dlOptions" runat="server">
<ItemTemplate >
<td>
<asp:RadioButto n ID="radOption" Text='<%#Eval(" Cost") %>'
runat="server" GroupName='<%# Eval("ShipTo")% /></td>
<td><asp:Labe l runat="server" ID="lblShipName "
Text='<%#Eval(" Name") & "-" & Eval("Desc")%>' ></asp:Label>
<asp:Label runat="server" ID="lblShipType " Text='<%#Eval(" Type")
%>'></asp:Label></td>
</ItemTemplate>
<SeparatorTempl ate>
<td>&nbsp;</td>
</SeparatorTempla te>
<FooterTemplate >
<td><img src="site_image s/spacer.gif" width="80" height="1"
/></td>
<td><img src="site_image s/spacer.gif" width="600" height="1"
/></td>
</FooterTemplate

Sep 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2840
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from Tkinter import * class GetVariant: def __init__(self): self.root = Tk()
3
36174
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to rewrite it so that it's W3C compliant. Reading through earlier messages I concluded I should go with getElementById but this doesn't work. What am I doing wrong? Your help is much appreciated.
3
7240
by: dave | last post by:
I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs a postback. I only want to do a postback if the value of the radiobutton is changed. What is the best method to accomplish this? thx dave
0
992
by: Luis Esteban Valencia Muñoz | last post by:
I have a DataList, which looks a bit like this: <asp:DataList id="dlstCheeseType" runat="server" RepeatColumns="4" RepeatDirection="Horizontal" ShowHeader="False" ShowFooter="False" ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%" Width="100%"> <ItemTemplate> <asp:RadioButton ID="cheeseChoice" Text='<%# Container.DataItem.Row("CheeseName") %>' Runat="server" GroupName="cheeseGroup"/>
0
1155
by: dfetrow410 | last post by:
I am using a datalist. I need to retrieve only selected values. I tried to use the following code below with no luck. Not sure how to do the backend <tr> <td align="left" valign="top"><img src="images/vote_slectionNon.gif" alt=" " width="103" height="25"></td> <td align="center" valign="top" width="24" background="images/vote_selection.gif"><asp:RadioButton ID="RadioButton2" runat="server" GroupName='<%# Eval("noID") %>,1'
6
9287
by: Radiobutton via DotNetMonster.com | last post by:
i need help with radiobuttons. i am useing 1button and 2 radiobuttons i am trying to make it so when u select a radiobutton and hit button1 it will clear radiobuttons 1 and 2. -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-csharp/200605/1
0
933
by: Gert | last post by:
Hi, I am struggling with something relative new to me. Using a simple datalist and a sqldatasource I am showing records in a 2 column wide table. Very easy, no real code so far. No I like to put a radiobutton in the itemtemplate (or where else) so let the user choose one of the items. Please help me,
1
1621
by: Nathan Sokalski | last post by:
I have a RadioButtonList as one of the Controls in the ItemTemplate of my DataList. I am using a For Each loop to go through the Items property, but even if one of the RadioButtons has been selected, they all return False. What am I doing wrong? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
8
44027
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is checked. In VB.Net if I enclose a group of radiobuttons in a groupbox control - I get the single checked radiobutton behavior, but the groupbox does not seem to return the index of the checked radiobutton. Is there a way to get the groupbox...
0
8265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.