|
-
Jul 3rd, 2007, 02:20 AM
#1
Thread Starter
Hyperactive Member
radiobutton question
is it possible to bind 2 radiobuttons to 1 column in a table... like for example, i have 2 radiobuttons... one labeled male then the other one is female... now in my table i have a gender column... then i want to bind this column to these 2 radiobuttons so if in a record it says male on that column then radiobutton1 will be marked and vice versa....
any suggestions?
thanks...
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Jul 3rd, 2007, 02:37 AM
#2
Re: radiobutton question
Presumably you mean you want to bind the Checked property of RadioButtons to the column. That doesn't really make sense because the Checked property is type Boolean but your column doesn't contain boolean values. You could derive your own class from RadioButton and declare a new property of the appropriate type to which you could bind your column.
-
Jul 3rd, 2007, 02:52 AM
#3
Thread Starter
Hyperactive Member
Re: radiobutton question
 Originally Posted by jmcilhinney
Presumably you mean you want to bind the Checked property of RadioButtons to the column. That doesn't really make sense because the Checked property is type Boolean but your column doesn't contain boolean values. You could derive your own class from RadioButton and declare a new property of the appropriate type to which you could bind your column.
oh i see... if for example i made my own class from RadioButton and added a Value Property for instance... i can bind 2 of them into only one column/field in my table?
coz there's this other programming tool i used before that has a Radio Group Control which you can add several Radio Buttons under it... then each button has a Value Property where you put the data to be stored on the column/field of the database... and even though you have several buttons, since you can only click one, only the Value of that button will be send to the table.
so im trying to do something like this in VB.Net...
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Jul 3rd, 2007, 02:59 AM
#4
Re: radiobutton question
You would define your own UserControl for that. You could add all the design-time support to allow you to change the number of selections at will, but that would be a bit of trouble. In your case I'd suggest just defining a UserControl with two static RadioButtons on it. You would then add whatever properties and other members were appropriate.
-
Jul 3rd, 2007, 03:21 AM
#5
Thread Starter
Hyperactive Member
Re: radiobutton question
ok... let me try doing that first...
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|