Monday, March 26, 2012

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

DanDan:

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" <dan@.musoswire.com> wrote in message
news:77D4C21A-54B8-472C-8C48-59093295DE98@.microsoft.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
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" <dan@.musoswire.com> wrote in message
> news:77D4C21A-54B8-472C-8C48-59093295DE98@.microsoft.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
>

0 comments:

Post a Comment