Home All Groups Group Topic Archive Search About

Databound RadioButton

Author
14 Sep 2006 3:56 PM
Dustin Davis
Setting up databindings for controls like textboxes and checkboxes is
pretty straightforward, but how do you set up a databound radio group?

For example, say I have source_type in my database that is an integer.
Valid values would be 1 and 2. I want to radio buttons on a form, one
for Directory and the other is Scanner. If they select Directory, the
value would be set to 1 and if they select scanner the value would be
set to 2 after updating the table adapter. How is this done?

I've thought of setting up some kind of hidden control use that to
control the radio buttons, but I was wondering if this was the best way.

Thanks,
Dustin

Author
14 Sep 2006 8:00 PM
Mike McIntyre
Here is a link to a MSDN article that presents one approach for the data
binding scenario you describe:

http://msdn.microsoft.com/msdnmag/issues/04/07/AdvancedBasics/
--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com


Show quoteHide quote
"Dustin Davis" <dus***@davisvillage.com> wrote in message
news:OkwxTXB2GHA.4972@TK2MSFTNGP03.phx.gbl...
> Setting up databindings for controls like textboxes and checkboxes is
> pretty straightforward, but how do you set up a databound radio group?
>
> For example, say I have source_type in my database that is an integer.
> Valid values would be 1 and 2. I want to radio buttons on a form, one for
> Directory and the other is Scanner. If they select Directory, the value
> would be set to 1 and if they select scanner the value would be set to 2
> after updating the table adapter. How is this done?
>
> I've thought of setting up some kind of hidden control use that to control
> the radio buttons, but I was wondering if this was the best way.
>
> Thanks,
> Dustin
Author
15 Sep 2006 2:00 PM
Dustin Davis
Thanks Mike. I'm thinking that seems like overkill (and kind of ugly).
Maybe I'll just use a combo box instead, or try a hidden field technique.

Mike McIntyre wrote:
Show quoteHide quote
> Here is a link to a MSDN article that presents one approach for the data
> binding scenario you describe:
>
> http://msdn.microsoft.com/msdnmag/issues/04/07/AdvancedBasics/
Author
15 Sep 2006 8:29 PM
Mike McIntyre
You are right-on.

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com


Show quoteHide quote
"Dustin Davis" <dus***@davisvillage.com> wrote in message
news:On0dA9M2GHA.4116@TK2MSFTNGP02.phx.gbl...
> Thanks Mike. I'm thinking that seems like overkill (and kind of ugly).
> Maybe I'll just use a combo box instead, or try a hidden field technique.
>
> Mike McIntyre wrote:
>> Here is a link to a MSDN article that presents one approach for the data
>> binding scenario you describe:
>>
>> http://msdn.microsoft.com/msdnmag/issues/04/07/AdvancedBasics/