Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Selected item in RadioButtonList

Reply
Thread Tools

Selected item in RadioButtonList

 
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      01-07-2005
My RadioButtonList has items with similar values. N/A has a value of 0;
Sometimes also has a value of 0; Never has a value of 1, etc.

I'm running into a huge problem in that if the selected item is Sometimes
(which is second in the list), the rbl.SelectedItem.Text property always
returns N/A instead (which is first in the list).

I'm getting a sick feeling that the control is returning the first item with
the value of 0, instead of the one that is really selected. I can't change
the values for these questions to be unique, and I don't want to use separate
radio buttons (I have over 100 questions that are multiple choice answers!).

Can someone help me resolve this? Is there a way to use the rbl with
non-unique values?
 
Reply With Quote
 
 
 
 
WJ
Guest
Posts: n/a
 
      01-07-2005

"Richard" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My RadioButtonList has items with similar values. N/A has a value of 0;
> Sometimes also has a value of 0; Never has a value of 1, etc.
>

You cannot do this. it is not possible in a Radio Button Group, each item
is unique. Because you can select only one item.

> Can someone help me resolve this? Is there a way to use the rbl with
> non-unique values?


Use Check List istead. This will allow you multiple choices.

John


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      01-07-2005
Thanks WJ. A checklist won't work because I don't want to allow multiple
selections (I goofed when I originally used that phrase--I meant that it
would be a lot of work because each question had more than Yes/No options.
The user has to choose only 1 out of 6 items).

"WJ" wrote:

>
> "Richard" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > My RadioButtonList has items with similar values. N/A has a value of 0;
> > Sometimes also has a value of 0; Never has a value of 1, etc.
> >

> You cannot do this. it is not possible in a Radio Button Group, each item
> is unique. Because you can select only one item.
>
> > Can someone help me resolve this? Is there a way to use the rbl with
> > non-unique values?

>
> Use Check List istead. This will allow you multiple choices.
>
> John
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get the selected item in RadioButtonList‎, that is in ajax tab container samin Software 0 12-13-2010 02:28 PM
DropDownList 2 always returns Selected = 0 for all items - even selected item Iain ASP .Net 3 12-11-2006 11:07 AM
Dynamically set selected item of RadioButtonList Groove ASP .Net 1 05-11-2006 03:09 PM
radiobuttonlist get selected item =?Utf-8?B?anVzdHN0YXJ0ZXI=?= ASP .Net 4 10-26-2005 05:30 PM
How to change font of selected item in RadioButtonList Peter Afonin ASP .Net Web Controls 6 02-23-2004 04:28 PM



Advertisments