Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Setting RadioButtonList selection

Reply
Thread Tools

Setting RadioButtonList selection

 
 
=?Utf-8?B?ZGhucml2ZXJzaWRl?=
Guest
Posts: n/a
 
      05-10-2005
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
 
Reply With Quote
 
 
 
 
David Lloyd
Guest
Posts: n/a
 
      05-10-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZGhucml2ZXJzaWRl?=
Guest
Posts: n/a
 
      05-10-2005
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>
>

 
Reply With Quote
 
 
 
Reply

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
Hiding tablerow based on radiobuttonlist selection chief21 ASP .Net 0 04-09-2009 03:53 AM
Focus/selection on RadioButton or RadioButtonList after postback BizEd ASP .Net 1 10-02-2007 09:51 PM
Cannot get radioButtonList selection VR ASP .Net Web Controls 2 06-29-2005 02:54 PM
JTable with row selection, but no cell selection Simon Niederberger Java 2 01-07-2005 04:17 PM
JS comparing innerHTML to text selection (window.getSelection() /document.selection) Andrew Crowe HTML 1 09-13-2004 02:22 PM



Advertisments