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

  • Home
  • SEARCH
  • 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 8216761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:14:35+00:00 2026-06-07T12:14:35+00:00

I have a weird problem. I have two stack panels, with a button in

  • 0

I have a weird problem. I have two stack panels, with a button in each, the data context of both stack panels are the same and the IsEnabled property on the buttons are also set to the same property. Yet one button is disabled and the other is enabled:

StackPanel #1 (Enabled):

<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1" Height="23"  DataContext="{Binding ElementName=LayoutRoot, Path=DataContext}">
    <TextBox Grid.Row="0" Grid.Column="1" Height="23" Width="220" Name="txtBarcode"></TextBox>
    <Button IsEnabled="{Binding CanAdd}" cal:Click.Command="{Binding AddBarcodeCommand}" Width="40" Content=". . ." Margin="5,0"></Button>
</StackPanel>

StackPanel #2 (Disabled):

<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right"  DataContext="{Binding ElementName=LayoutRoot, Path=DataContext}" >
    <Button HorizontalAlignment="Right" cal:Click.Command="{Binding ElementName=LayoutRoot, Path=DataContext.SaveCommand}" Grid.Row="3" Grid.Column="1" Height="30" Content="Create Batch" Width="130"></Button>
    <Button IsEnabled="{Binding CanAdd}" Height="30" Content="Apply" Width="130" HorizontalAlignment="Right" Margin="5,0"></Button>
</StackPanel>

I did not see any databinding errors in the output window. Is there something that I am missing?

  • 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-07T12:14:36+00:00Added an answer on June 7, 2026 at 12:14 pm

    It’s probably because of your command in the first Button:

    cal:Click.Command="{Binding AddBarcodeCommand}
    

    If that command has a CanExecute method defined for it, it will disable the button when that method returns false.

    It may also apply to SaveCommand

    I would remove the IsEnabled binding and let the CanExecute do its thing as it’s the point of commands to do so,
    but you can also fix the CanExecute logic or remove it and let the IsEnabled binding work.

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

Sidebar

Related Questions

I have weird problem with HOME button. I have two activities A and B.
I have a weird problem. When I execute a query the data is not
I'm stuck with a weird problem. I have two files a.c and b.c as
This is a weird problem. I have created Web User Control with two TextBoxes
I have a weird problem with a storyboard inside a button visual state manager.
I have a weird problem , below are two simple get calls and returning
I have a weird problem where two web apps with Oracle JDBC driver will
I have a weird problem. In my query I select 5 columns which two
Alright, this is a weird problem I'm having. I have two pages, which are
I have a weird problem with a Java Gregorian Calendar: SimpleDateFormat sdf = new

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.