473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Radio button binding

Dear Cor Ligthert

My account is not yet validated so i cannot log in to reply directly to
you.

An analogy of what i need is the following:
Say e.g. you have a groub box "Sex" and two radio buttons "Male" and
"Female".
When you recall the form to edit the information of the person to
change from male to female :) what is the binding i have to make. From
the properties i cannot do data binding cause there are two radio
buttons.

Thanks again

Jul 25 '05 #1
1 1916
Savvas

Your value is not Sex = true in my opinion, however Male = true and
therefore female is false.

The behaviour of a radiobutton in a groupbox is pretty for that.

See this sample. it needs only two radiobuttons in a groupbox and a button
on a form.
\\\\
Dim dt As New DataTable
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
dt.Columns.Add("Male", GetType(System.Boolean))
dt.LoadDataRow(New Object() {True}, True)
RadioButton1.DataBindings.Add("Checked", dt, "Male")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
BindingContext(dt).EndCurrentEdit()
MessageBox.Show(dt.Rows(0).ItemArray(0).ToString)
End Sub
///

I hope this helps,

Cor

"Savvas" <sa**************@gmail.com> schreef in bericht
news:11********************@g44g2000cwa.googlegrou ps.com...
Dear Cor Ligthert

My account is not yet validated so i cannot log in to reply directly to
you.

An analogy of what i need is the following:
Say e.g. you have a groub box "Sex" and two radio buttons "Male" and
"Female".
When you recall the form to edit the information of the person to
change from male to female :) what is the binding i have to make. From
the properties i cannot do data binding cause there are two radio
buttons.

Thanks again

Jul 25 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Savvas | last post by:
Hi I have two radio buttons of boolean type in a panel. When adding data to an access database or showing them via a query i have no problem. However, when i want to edit the data (they are in a...
0
by: Savvas | last post by:
Hi all I still havent managed to bind the radio buttons. I have two radio buttons in a groupbox. Adding a record and choosing either one of the two i have no problem - the correct boolean value...
2
by: Pauly | last post by:
I have a group of three radio buttons on a group box. In my database I have three columns all of data type bit. I want to bind each button so that if it is 1 then it selects the appropriate...
2
by: Neo | last post by:
I put a similar post for CheckBoxes, but i want to use a Radio button & not a CheckBox I have a field named "Male" & this is of SQL BIT data type (SQL Server). How can i bind this field to a...
1
by: Savvas | last post by:
Dear Cor Ligthert My account is not yet validated so i cannot log in to reply directly to you. An analogy of what i need is the following: Say e.g. you have a groub box "Sex" and two radio...
2
by: Peted | last post by:
Hi Im using c# express edition 2005 I have an MDI form, where i load multiple child forms from a dll i create, using reflection and late binding The child forms have multiple radio...
3
by: teddysnips | last post by:
Back in the dim mists of antiquity I used to program in VBA for Microsoft Access (hey, don't knock it - very useful tool for the right application). This had a really handy control in the...
0
by: jehugaleahsa | last post by:
Hello: I have radio buttons bound to boolean properties in a business object. private void bindRadioButton(RadioButton button, string propertyName) { Binding binding =...
1
by: jehugaleahsa | last post by:
Hello: When I clicked on a radio button, it does not get checked. Instead, the radio button group is cleared. This occurs because when one radio button loses its check, it sets the data...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.