#855 – RadioButtons Are Grouped Based on their Container

The RadioButton control acts as an exclusive selection, allowing you to pick one item at a time from a group of choices.  Only one RadioButton within the group can be selected at any given time and selecting one of the RadioButtons clears whichever button was previously selected.

You can have more than one group of RadioButtons within your application.  By default, the container that the RadioButtons belong to dictate the grouping, such that only one RadioButton within the parent container can be selected at a time.  This means that you can create a second group of RadioButtons by placing them in a second container.

        <StackPanel Margin="10">
            <RadioButton Content="Male"/>
            <RadioButton Content="Female"/>
        </StackPanel>

        <StackPanel Margin="10">
            <RadioButton Content="Tall"/>
            <RadioButton Content="Short"/>
        </StackPanel>

855-001

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #855 – RadioButtons Are Grouped Based on their Container

  1. Pingback: #904 – Placing RadioButtons in a TabControl | 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: