471,349 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

DataBinding to RadioButtons

I have a set of RadioButtons grouped in a GroupBox that I need to data
bind to a custom object. The custom object looks something like this:

public CustomObject
private bool checked1 = true;
private bool checked2 = false;
private bool checked3 = false;

public bool Checked1
get{ return this.checked1; }
set{ this.checked1 = value; }


Each radio button in the group box is bound like this:

radiobutton1.DataBindings.Add("Checked", myCustomObject, "Checked1");
radiobutton2.DataBindings.Add("Checked", myCustomObject, "Checked2");
radiobutton3.DataBindings.Add("Checked", myCustomObject, "Checked3");

If I run the form, the first radio button is selected, just as
expected. When I select the second radio button, the Checked2 property
is set to true, also as expected. But, the Checked1 property still
remains true, even though the radiobutton lost its selection! Any ideas
to how to get around this problem?


Jul 28 '05 #1
0 2066

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Martien van Wanrooij | last post: by
reply views Thread by Nevyn Twyll | last post: by
reply views Thread by MB | last post: by
2 posts views Thread by Chris Ashley | last post: by
reply views Thread by PaulS | last post: by
reply views Thread by | last post: by
reply views Thread by XIAOLAOHU | 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.