473,231 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

DataBinding to RadioButtons

MB
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?

MB

Jul 28 '05 #1
0 2112

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML:...
3
by: Martien van Wanrooij | last post by:
I am working on a site with some pages that all have a form that starts with a group of radiobuttons. By default none of the buttons is checked. Before submitting the form there is a validation...
0
by: Nevyn Twyll | last post by:
I have a set of radiobuttons that I want to put as an element in a Datalist. But I need the radiobuttons to have a very particular look, so I can't use the RadioButtonList class. So, I made a user...
0
by: MB | last post by:
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;...
2
by: Chris Ashley | last post by:
I have a couple of RadioButtons both with the same GroupName. Is there any way I can use a RequiredFieldValidator to ensure that at least one of the RadioButtons in the group is selected? Setting...
0
by: PaulS | last post by:
Hello! I put on Form PictureBox and I set big image. Next I put many radiobuttons (80) on PictureBox, but I have problem. I want that 10 radiobuttons have own Checked, next part of 10...
4
by: PedroVision | last post by:
I have a VB 2005 form with 140 different radiobuttons... Some are "checked", some are not... I want to reset all radiobuttons to "unchecked". I've been searching and trying differnet...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is...
0
by: | last post by:
I am using radiobuttons in a gridview, and not a column of radiobuttons. I have one cell in each row with several radiobuttons that the user has to choose a radiobutton within each row. How can I...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.