VB.net - GroupBox / Panel DataBinding and behavior

I am working on a throw-away application as a self-training tool to simply understand VS2015/VB.net. I am an expert with VBA and MsAccess since 1991.

In Access, the group box was pretty slick. You add as many radio buttons, buttons or checkboxes into the group control and each of the controls within the group control were assigned a value that was handled by the group control. The group control was bound to a table element for fetching and putting the data.

However, I learned that the VB.NET panel / groupbox only permits radio buttons for selection where only one radio button is true and any given moment and the others are false where checkboxes inside the groupbox/ panel do not behave that way. That's OK with me.

In my application, I have a panel control that has three radio buttons. I would like to store the value of the tag of the chosen RadioButton control into a data element in my table.

The questions:
1. Can a panel control be bound to a table element? In other words, can a groupbox or panel store data?
2. How does the binding take place? (e.g. FormControlName.DataBindings.Add(....)  )
3. How is the form populated so that the correct radio button is true when the record is fetched and displayed on the form?
3. Can you provide me with sample code so that I can mimic it in my throwaway application?

Thanks in advance!
Lenny GrayAsked:
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.

David Johnson, CD, MVPOwnerCommented:
1. Can a panel control be bound to a table element? In other words, can a groupbox or panel store data?

No they are only visual items.

2. How does the binding take place? (e.g. FormControlName.DataBindings.Add(....)  )

??

3. How is the form populated so that the correct radio button is true when the record is fetched and displayed on the form?

within your code you would use some sort of if/then approach to set the control's property to checked or unchecked

3. Can you provide me with sample code so that I can mimic it in my throwaway application?
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
Lenny GrayAuthor Commented:
Thanks, David!

This is not the "news" that I had hoped for! <grin>

The functionality of the option group in Access is something that hopefully the Visual Studio team could adopt and include in future releases. Or maybe, someone could create a custom control that offers that functionality.

I will write the necessary code.

I am very appreciative of your quick and concise response. You are gifted and we are blessed to benefit from your generosity for sharing your talent.

Lenny
0
Lenny GrayAuthor Commented:
I am very appreciative of your quick and concise response. You are gifted and we are blessed to benefit from your generosity for sharing your talent.

Lenny
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
Visual Basic.NET

From novice to tech pro — start learning today.