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

Home Posts Topics Members FAQ

datagrid and radio buttons

Jay
I noticed somewhere on the net that a post mentioned that there was a bug in
the datagrid, radio buttons and a repeater. Something about the radio
buttons are not mutually exclusive. (will this be fixed soon)

I am trying to create a survey form where the 4 radio buttons are created
dynamically for each question in the database. Is there an example of this
somewhere. The radio buttons are based on a seperate table called survey
answers. What I am looking for is what does the html look like and how do I
write the code to handle the server side events.

Thank You All for participating
Nov 18 '05 #1
3 2281
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@h otmail.com> wrote in message
news:3W7Qb.3504 7$zP6.19983@oke pread02...
I noticed somewhere on the net that a post mentioned that there was a bug in the datagrid, radio buttons and a repeater. Something about the radio
buttons are not mutually exclusive. (will this be fixed soon)

I am trying to create a survey form where the 4 radio buttons are created
dynamically for each question in the database. Is there an example of this somewhere. The radio buttons are based on a seperate table called survey
answers. What I am looking for is what does the html look like and how do I write the code to handle the server side events.

Thank You All for participating

Nov 18 '05 #2
Jay
why am i getting the following error message when I compile the
RowSelectorColu mn DOT NET project that I downloaded from the site that you
suggested?

I got it from http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

Cryptographic failure while signing assembly

Thank You for any and all help with this matter.
"Michael" <raterus@localh ost> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@h otmail.com> wrote in message
news:3W7Qb.3504 7$zP6.19983@oke pread02...
I noticed somewhere on the net that a post mentioned that there was a bug
in
the datagrid, radio buttons and a repeater. Something about the radio
buttons are not mutually exclusive. (will this be fixed soon)

I am trying to create a survey form where the 4 radio buttons are
created dynamically for each question in the database. Is there an example of

this
somewhere. The radio buttons are based on a seperate table called survey answers. What I am looking for is what does the html look like and how

do I
write the code to handle the server side events.

Thank You All for participating


Nov 18 '05 #3
Customizing the datagrid to use radio buttons requires a couple lines of
code. I provide an example here as alternative to downloading and installing
a component.

In your datagrid itemdatabound event handler, this line of code adds a
radiobutton to each row.
if(e.Item.ItemT ype == ListItemType.It em || e.Item.ItemType ==
ListItemType.Al ternatingItem)

{

Label lbl = (Label)e.Item.F indControl("Dig ");

if(lbl != null)

lbl.Text = "<input type=radio name='samegroup ' value='" +
e.Item.Cells[1].Text + "'>";

}
The code assumes that you have created a datagrid with an item template
column contianing a field called "Dig". This part is entirely optional as
you can just add the lbl control to any column.

The reason why mutually exclusive radio buttons don't work from the
code-behind is that the datagrid implements the INamingContaine r interface
which forces each implementor to generator unique names for the html content
rendered clientside. Therefor, the mutually exclusivity is lost with the
unique renaming. Using javascript like the code provided above ensures that
the radio button created clientside has a family groupname.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jay" <ja**********@h otmail.com> wrote in message
news:O6yQb.4053 6$zP6.39600@oke pread02...
why am i getting the following error message when I compile the
RowSelectorColu mn DOT NET project that I downloaded from the site that you
suggested?

I got it from http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

Cryptographic failure while signing assembly

Thank You for any and all help with this matter.
"Michael" <raterus@localh ost> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@h otmail.com> wrote in message
news:3W7Qb.3504 7$zP6.19983@oke pread02...
I noticed somewhere on the net that a post mentioned that there was a bug
in
the datagrid, radio buttons and a repeater. Something about the radio
buttons are not mutually exclusive. (will this be fixed soon)

I am trying to create a survey form where the 4 radio buttons are
created dynamically for each question in the database. Is there an example of

this
somewhere. The radio buttons are based on a seperate table called survey answers. What I am looking for is what does the html look like and

how do
I
write the code to handle the server side events.

Thank You All for participating



Nov 18 '05 #4

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

Similar topics

4
3266
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1> <input type="radio" name=p2 value=2> <input type="radio" name=p2 value=3> then a text area and a button:
6
3279
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked The problem i am facing is that i do not know how many yes/no radio groups will be generated
2
2144
by: Gidi | last post by:
hi, i have a dataGrid and few radio buttons. i want that each time the radio buttons change the dataGrid dataSource and dataMember will change to. i know how to change the dataMember but when i tried to make the dataSource property to be the new dataSource (for example: if it was dataGrid1.DataSource="a" when i pressed the radioButton i changed it to be dataGrid1.DataSource="b") but what i'm getting is an empty table with a "+"
2
1356
by: David Kleyman | last post by:
Hello Is there a way to add a radio button as a bound column to a datagrid? I can not find any info on how to do that If you have a sample of the code that does it please share Thank you David
1
1601
by: Jay | last post by:
I need to validate 21 sets of radio buttons before submission to the server for calculation and storage. Is it best to validate on the client side using javascript or to validate on the server using the code behind vbscript. It seems that natural to validate before submission. If javascript is the best then how do I the variables. I noticed some javascript that was dynamically created which looks like the following: ...
5
1938
by: Eric Caron | last post by:
Hi everyone, I have a web form that asks the user what languages he speaks and what his skill level is. I used a DataGrid control bound to a table that contains the languages and three template columns (beginner, intermediate, expert) that contain a radio button control. Now, only one skill level can be selected per language, so I tried to give the same name to the radio button control. When the page loads for the first time,...
1
1486
by: RN | last post by:
Hi. I used this article to add a template column to a datagrid that is entirely created with code: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskcreatingtemplatesprogrammaticallyindatagridcontrol.asp It works fine except for one thing. My template column needs a field in the recordset that binds to the datagrid. The template column is an HTML radio button where the value of the radio button needs...
2
5886
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on the form by changing the visible state of the radio buttons and labels utilising back and next buttons. E.g. Next button makes current radio buttons and labels invisible and
2
2057
by: JimS | last post by:
I am using DotNet 2.0 and Visual Studio 2005. The project is a web project. I am currently using an ObjectDataSource to populate a datagrid. The ObjectDataSource is configured to a function in a class to populate the initial load of data. I would like to use a Radio Button list to change the data viewed in the Grid. What is the best practice to perform this task. Is it better to have a default value for the Radio Buttons and have the...
0
8203
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7203
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...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
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...
1
2630
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
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1515
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.