471,330 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 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 1806
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Savvas | last post: by
2 posts views Thread by Pauly | last post: by
1 post views Thread by Savvas | last post: by
reply views Thread by jehugaleahsa | last post: by
1 post views Thread by jehugaleahsa | last post: by
reply views Thread by rosydwin | last post: by

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.