473,395 Members | 1,701 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,395 software developers and data experts.

Dynamically set selected item of RadioButtonList

I've searched numerous threads and posts and can't seem to find a fitting
answer. Hopefully this is simple - it seems very simple.

I'm trying to set a SelectedValue of a RadioButtonList to a value from a db
record upon page load. Yet, when the page loads, the RBL has nothing
selected.

Any ideas? The value from the record is definitely a 0 or a 1.

....in page_load ..

radAccommodated.SelectedValue = drData1("AllAccommodated")

...on page...

<asp:RadioButtonList ID="radAccommodated" runat="server" CellPadding="3"
CellSpacing="0" Width="90%">

<asp:ListItem Value="1">Yes, all requests accommodated.</asp:ListItem>

<asp:ListItem Value="0">No, all are not accommodated. .</asp:ListItem>

</asp:RadioButtonList>

Thanks!


May 11 '06 #1
1 3446
Nevermind. Db field was defined as bit. I redefined it as TinyInt.

Thanks!

"Groove" <no***@noemail.com> wrote in message
news:uT**************@TK2MSFTNGP04.phx.gbl...
I've searched numerous threads and posts and can't seem to find a fitting
answer. Hopefully this is simple - it seems very simple.

I'm trying to set a SelectedValue of a RadioButtonList to a value from a
db record upon page load. Yet, when the page loads, the RBL has nothing
selected.

Any ideas? The value from the record is definitely a 0 or a 1.

...in page_load ..

radAccommodated.SelectedValue = drData1("AllAccommodated")

..on page...

<asp:RadioButtonList ID="radAccommodated" runat="server" CellPadding="3"
CellSpacing="0" Width="90%">

<asp:ListItem Value="1">Yes, all requests accommodated.</asp:ListItem>

<asp:ListItem Value="0">No, all are not accommodated. .</asp:ListItem>

</asp:RadioButtonList>

Thanks!


May 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: krzysiek | last post by:
hello, i have several radiolists and checkboxlist that are generated dinamicly based on datasource. So frankly speaking i don't know names and number of that web controls cose they are always...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
5
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator;...
0
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event,...
1
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.