473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 2267
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@hotmail.com> wrote in message
news:3W7Qb.35047$zP6.19983@okepread02...
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
RowSelectorColumn 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@localhost> wrote in message
news:ux**************@tk2msftngp13.phx.gbl...
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@hotmail.com> wrote in message
news:3W7Qb.35047$zP6.19983@okepread02...
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.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)

{

Label lbl = (Label)e.Item.FindControl("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 INamingContainer 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**********@hotmail.com> wrote in message
news:O6yQb.40536$zP6.39600@okepread02...
why am i getting the following error message when I compile the
RowSelectorColumn 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@localhost> wrote in message
news:ux**************@tk2msftngp13.phx.gbl...
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx

"Jay" <ja**********@hotmail.com> wrote in message
news:3W7Qb.35047$zP6.19983@okepread02...
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
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>...
6
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 ...
2
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...
2
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 ...
1
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...
5
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...
1
by: RN | last post by:
Hi. I used this article to add a template column to a datagrid that is entirely created with code: ...
2
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.