473,486 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1921
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
2094
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
1581
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
2488
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
7960
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
295
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
2873
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
18568
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
2282
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
1786
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
6964
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
7175
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...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.