Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:53:38+00:00 2026-06-13T16:53:38+00:00

I have several RadioButtons combined in one Group so that only one can be

  • 0

I have several RadioButtons combined in one Group so that only one can be checked. The RadioButtons are bound to boolean Properties.

This works very well and my program reacts on the changes of these Properties.

Suppose optA is selected. Next I select optB, the value of PropertyB is set to true and my program reacts accordingly. However, at this time both optA and optB are true until the Group of Radio buttons updates optA to false which again triggers my “IsSelected” event.

I think this is totally correct behavior…
But how can I distinguish between a change from the user and the automated change from the group?

Edit: Code

<RadioButton Name="featureCheckBox" GroupName="featureRadioButtonGroup" IsChecked="{Binding Path=IsSelected, Mode=TwoWay}" />

 public bool IsSelected { 

        get{ return _isSelected; }
        set { PropertyChanged.ChangeAndNotify(ref _isSelected, value, () => IsSelected); }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:53:39+00:00Added an answer on June 13, 2026 at 4:53 pm

    First of all to answer your question.

    Change the set portion of the IsSelected property as follows. (You will of course have to write the actual code for the if statement)

    public bool IsSelected 
    { 
    
        get{ return _isSelected; }
        set 
        {
            //If two options are true wait for the second change of values
            //You will now only get One notification per change.
            if (twoOptions are selected) return;
            else PropertyChanged.ChangeAndNotify(ref _isSelected, value, () => IsSelected); 
        }
    }
    

    You could instead just listen for false values but then you’d have to set an arbitrary options to true to begin with. Or you could just listen for true values and ignore all false values which means you will have problems with multiple Properties being true until the group box updates the old option to false.

    Now for the advice.

    A much better model would be this.

    1. Create a boolean property for each option. (optA, optB, optC, etc.)
    2. When one of these properties is set to true, set all the other options to false via code in the model where the properties are declared.
    3. Bind each radio button to an option but do NOT group them. (Grouping them causes the UI to force the selection of only one. This does not lend itself to separation of UI and business logic.)

    Several benefits of doing it this way.

    1. You can rip out the UI and change it to something else without changing the business logic. (In other words you could bind the properties to RadioButtons, ToggleButtons, etc. without having to change ANY code.)
    2. You can more easily unit test your business logic because a UI isn’t even required.
    3. You can implement custom grouping of your options. (maybe you’ll add optZ that is actually valid to be selected along with optC. In this case you’d want to switch away from radio buttons since they indicate that only one option may be selected at a time)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have several radiobuttons in a group, and you have Checked event handlers
If I have several radio buttons of the same name, only one can be
I have several different numbers in a group that range in sizes and would
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
I have a repeater control that houses several RadioButtonLists with various RadioButtons in each
I have this login page managed in php. It contains several checkboxes, radiobuttons and
I have several R functions that save files to drop box (mainly plots). This
I have several radio buttons that are dynamically populated on a form and I
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have several Delphi programs that maintain connections to a database (some Oracle, some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.