Selected item in RadioButtonList

Discussion in 'ASP .Net' started by =?Utf-8?B?UmljaGFyZA==?=, Jan 7, 2005.

  1. 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?
    =?Utf-8?B?UmljaGFyZA==?=, Jan 7, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?UmljaGFyZA==?=

    WJ Guest

    "Richard" <> wrote in message
    news:...
    > 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
    WJ, Jan 7, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > > 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
    >
    >
    >
    =?Utf-8?B?UmljaGFyZA==?=, Jan 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?anVzdHN0YXJ0ZXI=?=

    radiobuttonlist get selected item

    =?Utf-8?B?anVzdHN0YXJ0ZXI=?=, Oct 25, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,103
    S. Justin Gengo
    Oct 26, 2005
  2. Groove
    Replies:
    1
    Views:
    14,348
    Groove
    May 11, 2006
  3. Iain
    Replies:
    3
    Views:
    914
  4. mldardy
    Replies:
    0
    Views:
    950
    mldardy
    Sep 28, 2010
  5. Peter Afonin

    How to change font of selected item in RadioButtonList

    Peter Afonin, Feb 22, 2004, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    614
    Peter Afonin
    Feb 23, 2004
Loading...

Share This Page