473,395 Members | 1,689 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.

Setting RadioButtonList selection

Hi guys

I have a radiobuttonlist with 3 listItems, with values 0, 1 and 2
respectively.

My database stores the number, but how do I set the selected on the brl to
correspond with the database.

I tried rblMyRBL.Items.FindByValue(dbfield).Selected = true;

but the selection doesn't change. Any thoughts?

Cheers
Dan
Nov 19 '05 #1
2 2760
Dan:

Try using the SelectedValue property of the RadioButtonList.

For example:

rblMyRBL.SelectedValue = 2
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"dhnriverside" <da*@musoswire.com> wrote in message
news:77**********************************@microsof t.com...
Hi guys

I have a radiobuttonlist with 3 listItems, with values 0, 1 and 2
respectively.

My database stores the number, but how do I set the selected on the brl to
correspond with the database.

I tried rblMyRBL.Items.FindByValue(dbfield).Selected = true;

but the selection doesn't change. Any thoughts?

Cheers
Dan
Nov 19 '05 #2
Cheers David, that sorted it!

Dan

"David Lloyd" wrote:
Dan:

Try using the SelectedValue property of the RadioButtonList.

For example:

rblMyRBL.SelectedValue = 2
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"dhnriverside" <da*@musoswire.com> wrote in message
news:77**********************************@microsof t.com...
Hi guys

I have a radiobuttonlist with 3 listItems, with values 0, 1 and 2
respectively.

My database stores the number, but how do I set the selected on the brl to
correspond with the database.

I tried rblMyRBL.Items.FindByValue(dbfield).Selected = true;

but the selection doesn't change. Any thoughts?

Cheers
Dan

Nov 19 '05 #3

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

Similar topics

3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
2
by: Serg | last post by:
Hello, I need to set the selection in the RadioButtonList according to the value of SelectedValue in the underlying dataset - please suggest. The code is below. Thank you. <asp:TemplateColumn>...
2
by: David P. Donahue | last post by:
I'm having a strange problem with a RadioButtonList (manually populated in the HTML, not data-bound) on one of my ASP .NET pages. I have the user select a value and click a button, then the...
1
by: lb | last post by:
Hello, I am trying to use a radiobuttonlist with the new multiview control. Am having trouble understanding how to build the radiobuttonlsit just one time, and not many times. In my first...
0
by: BizEd | last post by:
I have a textbox that fires an autopostback when filled in. The next field after the textbox is a RadioButtonList which I set focus to. The radiobutton list does have focus and activates when you...
2
by: Vahagn | last post by:
Hi, how do I retrieve the chosen value from a RadioButtonList? I have a RadioButtonList that is populated dynamically with a "Next" button. Ie, I have a list of questions each with 2-3 answer...
0
by: frankiefrank | last post by:
Hello, I have an aspx page with a RadioButtonList that has two Items, and a "ComboBox" (DropDownList) that I want to populate based on the selection in the RadioButtonList. The first...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.