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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:26:28+00:00 2026-05-31T01:26:28+00:00

Update: this issue is confirmed fixed on .NET 4.0 (I was using 3.5). I’m

  • 0

Update: this issue is confirmed fixed on .NET 4.0 (I was using 3.5).

I’m trying to use a checkbox so that it can be set manually by the user, unless a combobox in the same Window has a specific value (in which case the checkbox is disabled and checked).

This works perfectly, until the user manually checks/unchecks the box. After that, the IsChecked=True setter stops working when the value in the combobox is changed. The IsEnabled=False setter continues to work as expected.

I ended up having to use some logic in the code-behind, when I had hoped it would be possible using pure Xaml.

Does anyone know if this is a bug or intended behaviour. And if so, why?

<CheckBox>
Some text here
<CheckBox.Style>
    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="IsChecked" Value="False" />
        <Setter Property="IsEnabled" Value="True" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=SelectedValue, ElementName=comboBox1, Mode=OneWay}" Value="Disable Checkbox">
                <Setter Property="IsChecked" Value="True" />
                <Setter Property="IsEnabled" Value="False" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
</CheckBox.Style>
</CheckBox>

Thanks.

  • 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-31T01:26:29+00:00Added an answer on May 31, 2026 at 1:26 am

    there is something else going on in your project.

    I tried the following:

    <Window x:Class="Test.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow"
            Name="Window"
            SizeToContent="WidthAndHeight">
        <StackPanel>
            <CheckBox>
                some text here
                <CheckBox.Style>
                    <Style TargetType="{x:Type CheckBox}">
                        <Setter Property="IsChecked" Value="False" />
                        <Setter Property="IsEnabled" Value="True" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=SelectedIndex, ElementName=combo, Mode=OneWay}" Value="2">
                                <Setter Property="IsChecked" Value="True" />
                                <Setter Property="IsEnabled" Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </CheckBox.Style>
            </CheckBox>
            <ComboBox Name="combo">
                <TextBlock>item 1</TextBlock>
                <TextBlock>item 2</TextBlock>
                <TextBlock>item 3</TextBlock>
                <TextBlock>item 4</TextBlock>
                <TextBlock>item 5</TextBlock>
            </ComboBox>
        </StackPanel>
    </Window>
    

    So very easy. The goal here, is to set exactly the same values as yours for IsEnable and IsChecked when the item 3 is selected in the comboBox

    and it works like a charm. That is : the user check/uncheck the checkbox as he pleases, then when he choses “item 3” in the comboBox, the checkbox is checked and disabled. If he changes chosen item in the comboBox again, the Checkbox is unchecked and re-enabled and he can check/unckeck it again and again.

    So there is something else going on for you. What you wrote should work.

    Edit: With regards to your comment, I tested with the 3.5 version instead of the 4.0 I was first using and could indeed reproduce your issue, so this is clearly a bug that was fixed in the 4.0 version of the .net framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this exact issue ASP.net can’t update page from event handler and it's
Update: This issue was fixed in Redemption 5.2 : Previously, named MAPI properties in
UPDATE: This issue has been fixed as of Xcode 4.6! This technique now works
Update: This issue was not properly explored. The real issue lies within render :json
Update : This is a confirmed bug in Silverlight 4 beta. http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=523052 I solved
I'm seeing this issue . I have a relatively simple ASP.NET page with a
OK, i have confirmed i only this issue when i attempt to query on
Update: This bug has been confirmed by at least two others. Even if you
Update: This turned into a blog post, with updated links and code, over at
Update: this question, including the title, was rephrased, see history for details I know

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.