You cannot. Think about this... If I bind oth radio buttons to the same field and assuming the value is true BOTH of the controls cannot be true
RadioButton1.DataBindings.Add("Checked", ds, "Cust.Contract")
RadioButton2.DataBindings.Add("Checked", ds, "Cust.Contract")
then what is going to happen is that Radio button 2 is going to be set to the true value and clear 1 even though 1 should also be true.
What you need to do is bind another control (Like a Textbox) then trap the Change events and set the Radio buttons accordingly, and trap the Radio button events to set the value
of the text box that is bound.
Want to know more? Check out the MSDN Library at
http://msdn.microsoft.com or the Microsoft Knowledge Base at
http://support.microsoft.com
Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email :
(E-Mail Removed) <Remove word online. from address>
This posting is provided “AS IS”, with no warranties, and confers no rights.
--------------------
>From: "Srikanth" <(E-Mail Removed)>
>Subject: DataBinding a RadioButton group
>Date: Tue, 19 Aug 2003 15:49:19 +1000
>Lines: 11
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <#(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.windowsforms
>NNTP-Posting-Host: 65-58.dsl.connexus.net.au 203.222.65.58
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.windowsforms:50510
>X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
>
>Hi,
> I have two RadioButtons in a GroupBox. I want to databind these
>radiobuttons with a value (if '0', one radiobutton is checked else another)
>of a column in a DataTable.
>
>Iam not able to figure out how to do this. Please someone help me.
>
>Regards,
>Srikanth.
>
>
>