RadioButton List to Match with Data Table

Discussion in '.NET' started by AOhlert, Jul 13, 2009.

  1. AOhlert

    AOhlert

    Joined:
    Jul 13, 2009
    Messages:
    1
    Ok, I might be getting terminology confused (see: datatable), but I have a RadioButton list on my .aspx page in Visual Studio 2008. I want to select one of three options (yes, no, n/a) based on an entry in my data table (with values of Y, N, or NA). This is what I have so far:

    HTML:

    <asp:RadioButtonList ID="StorageRadioList" runat="server"
    RepeatDirection="Horizontal">
    <asp:ListItem value="Y" >Yes</asp:ListItem>
    <asp:ListItem value="N" >No</asp:ListItem>
    <asp:ListItem value="NA" Selected="True">N/A</asp:ListItem>
    </asp:RadioButtonList>

    Is there a way i can select one of the three buttons based on the value in the table. For example, if i created a hidden text box and assigned the value as a string to that textbox, could i then say like, "if txtbox==N, storageRadioList.N==selected" or something less pseudo-coded than that?

    I'm trying to avoid creating a datasource//control for it, as 1) i don't understand it very well, and 2) I don't have a table that has text descriptions for each button so each one has "Yes", "no", etc. next to it. I also am unable to edit the table im working with.

    Any help is appreciated.

    Edit: My codebehind is C#, not Visual Basic.
    I've tried

    this.FuelStorageRadio.SelectedValue = equipmentDataRow["Fule_Storage_onsite"].ToString();

    for the C# to select the button, but nothing works. The table is mispelled as "Fule" and only has values, "Y, N, or NA" just like my associated values listed above.
    Last edited: Jul 14, 2009
    AOhlert, Jul 13, 2009
    #1
    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. hiwa
    Replies:
    0
    Views:
    637
  2. Rio
    Replies:
    4
    Views:
    1,188
  3. howboutafresca@hotmail.com

    Any editors that can match <table> and </table> tags?

    howboutafresca@hotmail.com, Oct 3, 2006, in forum: HTML
    Replies:
    6
    Views:
    328
    jussij@zeusedit.com
    Oct 5, 2006
  4. Anthony Williams
    Replies:
    10
    Views:
    585
    Anthony Williams
    Sep 16, 2003
  5. Net Developer

    Radiobutton list from a table

    Net Developer, Jun 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    121
    Net Developer
    Jun 7, 2005
Loading...

Share This Page