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 818847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:12:49+00:00 2026-05-15T02:12:49+00:00

I am using a WPF tab control to present separate repeated instances of a

  • 0

I am using a WPF tab control to present separate repeated instances of a user control. i.e. Tab1 for Item1 settings, Tab2 for Item2 settings, and so on.

It appears that the radio button group names are being shared between tabs. What is going on?

Simple example:

A window contains tabs. Each tab contains a user control.

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lib="clr-namespace:WpfApplication1"
Title="Window1" Height="300" Width="300">
<Grid>
    <TabControl Margin="0,0,0,100" Name="tabControl1">
        <TabItem Header="tabItem1" Name="tabItem1">
            <lib:UserControl1 x:Name="userControlInTab1" />
        </TabItem>
        <TabItem Header="tabItem2" Name="tabItem2">
            <lib:UserControl1 x:Name="userControlInTab2" />
        </TabItem>
    </TabControl>
</Grid>

The user control is simply two radiobuttons in a group:

<UserControl x:Class="WpfApplication1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="50" Width="100">
<StackPanel>
    <RadioButton GroupName="Group1" Name="radiobutton1" Content="option1" IsChecked="True" />
    <RadioButton GroupName="Group1" Name="radiobutton2" Content="option2" />
</StackPanel>

If you run this app, you will see that only the radiobutton1 in the second tab is checked, despite the usercontrol defining it to always be checked at startup.

Further, setting a radiobutton as checked in code behind seems to uncheck all the radiobuttons in other tabs!

It seems like things behave fine under mouse control (i.e. tabs are independent).

Lastly, the usercontrols do seem to be separate instantiations. I have tried this with sliders on user controls, for example, and they do behave independently across tabs. As they should.

Thanks for anyone’s help with this. I have searched widely to no avail. Surely I’m not the only person who has had this issue. I’m using VS2008.

  • 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-05-15T02:12:50+00:00Added an answer on May 15, 2026 at 2:12 am

    Without the GroupName set it works. It is not strictly necessary since the RadioButtons in one container are automatically grouped anyway. For example:

    <UserControl x:Class="WpfApplication1.UserControl1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Height="50" Width="100">
        <StackPanel>
            <StackPanel>
                <RadioButton  Name="radiobutton1" Content="option1" IsChecked="True" />
                <RadioButton  Name="radiobutton2" Content="option2" />
            </StackPanel>
            <StackPanel>
                <RadioButton  Name="radiobutton3" Content="option3" IsChecked="True" />
                <RadioButton  Name="radiobutton4" Content="option4" />
            </StackPanel>
        </StackPanel>
    </UserControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a Tab control in WPF and the Tab control contains a WebBrowser
I am using WPF WebBrowser control and I want to acces some of the
I have a WPF Menu and a Tab control. I would like the list
I have wpf application in which I am using ENTER key as TAB &
I am using the DevComponents TabNavigation control for WPF, and am able to add
I have a wpf application using mvvm approach. The main window contains a tab
I have idea to implement my wpf windows like TabPages in tab control. It
I am using WPF WebBrowser control. How can I detect all outgoing Http GET
I'm having a problem with the WPF Tab View control that I was hoping
In a WPF 4 app, I have a very big user control full of

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.