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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:23:30+00:00 2026-05-17T20:23:30+00:00

I have a strange situation: in a .NET CF project there is a class

  • 0

I have a strange situation:

in a .NET CF project there is a class (call it A) which has the following structure:

public partial class A: Form, INotifyPropertyChanged
{
//for simplicity stripping off everything unrelated to this problem

        private int _SelectedRowsCount = 0;
        public int SelectedRowsCount
        {
            get { return _SelectedRowsCount; }
            set
            {
                _SelectedRowsCount = value;
                OnPropertyChanged("SelectedRowsCount");
            }
        }

        public bool enableCollectionButton
        {
            get { return SelectedRowsCount > 0; }
        }

//....
//
//


         void SomeMethod()
{
 //for simplicity:
SelectedRowsCount = 1; //<- HERE NOT FIRING Propertychanged for enableCollectionButton
}
}

The class implements correctly the INotifyPropertyChanged interface which makes the the SelectedRowsCount property to fire a property changed notification (i evaluated this with the debugger).
The enableCollectionButton property is databound to some control like so:

someButton.DataBindings.Add("Enabled", this, "enableCollectionButton");

But the enableCollectionButton property does not change (though depending on the value of SelectedRowsCount). This property should be evaluated on a change of the SelectedRowsCount property, BUT IS NOT!!!

Why is this not functioning, what do i miss??

Thanks in advance

  • 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-17T20:23:30+00:00Added an answer on May 17, 2026 at 8:23 pm

    Try this

    public partial class A: Form, INotifyPropertyChanged
    {
    //for simplicity stripping off everything unrelated to this problem
    
        private int _SelectedRowsCount = 0;
        public int SelectedRowsCount
        {
            get { return _SelectedRowsCount; }
            set
            {
                _SelectedRowsCount = value;
                OnPropertyChanged("SelectedRowsCount");
                OnPropertyChanged("enableCollectionButton"); //This changes too !
            }
        }
    
        public bool enableCollectionButton
        {
            get { return SelectedRowsCount > 0; }
        }
    }
    

    What happens is that you’re binding to the enableCollectionButton property, but you’re not notifying the BindingManager of the change to enableCollectionButton, rather of the change to SelectedRowsCount. The BindingManager doesn’t know they’re related!

    Also try using Microsoft’s naming conventions, enableCollectionButton should be EnableCollectionButton

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

Sidebar

Related Questions

I am new to VB.net and facing a strange situation. I have a structure
really strange situation I got here. I have 2 classes. @Entity public class CategoryData
I have a strange situation in my .NET CF 3.5 Windows Mobile 6.5 application.
I have a strange situation on a production server. Connection for asp.net get queued
I have a strange situation where the following code works however XCode warns it
I have this strange call stack and I am stumped to understand why. It
I have a strange requirement to ship an application without bundling .Net framework (to
I have a strange problem with VS2008. My solution has 8 projects (all c#)
The situation is like this : Main project A. and a class library B.
I am stuck with redirecting problem in ASP.NET MVC project. I have mapped tables

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.