472,978 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,978 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 1886
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.