SetFocus() to an item in a radiobuttonlist

Hello Experts,

On button click, I need to be able to set the focus to an item in a radiobuttonlist.
Just can't seem to figure this out.

Thanks!
LVL 2
GRCHELPDESKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Praveen VenuTechnical Project ManagerCommented:
Can you try this

Drop a panel on the form and put a RadioButtonList on the panel.  Then you set focus to the panel.        

SetFocus(this.PanelRadioList);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GiftsonDJohnCommented:
Can you try this.

ListItem selectedItem = radioButtonList.SelectedItem;
selectedItem.Attributes.Add("onload", "this.focus();");
0
GRCHELPDESKAuthor Commented:
Hello Everyone,
As it turns out, Praveenvenu's solution worked.  Honestly, I don't understand why.  Does setting focus to a container in effect set focus to the first item in the container?
GiftsonDJohn, thanks for the solution but looks like Praveenvenu got there first.
I appreciate all the help, thanks very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.