Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RadioButton List to Match with Data Table

Thread Tools

RadioButton List to Match with Data Table

AOhlert AOhlert is offline
Junior Member
Join Date: Jul 2009
Posts: 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:


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

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 by AOhlert; 07-14-2009 at 03:59 PM..
Reply With Quote

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
Any editors that can match <table> and </table> tags? HTML 6 10-05-2006 06:20 AM
Radiobutton list from a table Net Developer ASP .Net Web Controls 0 06-07-2005 09:04 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Java regex can't match lengthy match? hiwa Java 0 01-29-2004 10:09 AM
Retrieving checked RadioButton controls which were added to a Table control Anthony Williams ASP .Net Web Controls 10 09-16-2003 09:43 AM