473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problems with events

Hello,

I have a class library with many classes and properties. For every
property I have a PropertyNameChanged event. In my user interface layer
it sometimes happens that I subscribe such an event from multiple
places.

For example, I have a Property "Active" on a class. This property is
bounded to a CheckBox control in a user control. When this property
changes to false, there is one code which removes the UserControl from
the form (in some circumstances). The DataBinding code of the CheckBox
also subscribes my ActiveChanged event to refresh the control.

My problem is that when I trigger the ActiveChaged event in my class
library, I get a NullReference exception in the
System.Windows.Forms.BindToObject.PropValueChanged method. I
reflectored that method: The reason is that the bindingManager object
is null, and I understand why: When I trigger the event in the class
library, I do not care and I dont want to care about the order in which
the several event handler methods are fired. So in my case, the handler
which removes my usercontrol fires first. at that moment, the
databinding is removed. But the second event handler (PropValueChanged
in the BindToObject class) is still fired.

To find a workarraund to this problem is not to difficult, I could
remove the databindung from that checkbox. But I´m sure I will have
that problem on multiple places and I would like to know a correct
solution. So where is my failure?

best regards

Dirk

Jan 24 '07 #1
0 971

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jfixsen | last post by:
Hello! Oracle 9.2.0.4 SunOS pchi-db01 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-EnterpriseSystem = SunOS Node = pchi-db01 Release = 5.8 KernelID = Generic_108528-19 Machine = sun4u...
1
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP...
6
by: Not Me | last post by:
Hi, I have a stored procedure as a recordsource for a form, taking a parameter from another form, it displays records that are already present without any problems. I had to add a resync...
26
by: jamesbeswick | last post by:
I've been using Access since version 97 and I've migrated to 2003. I've noticed a substantial number of strange ActiveX/OLE and code corruption problems when writing databases. The only solution...
3
by: Tim Mulholland | last post by:
i posted this a while ago and never got a response, but i'm still having problems, so i thought i'd see if anyone had any sudden realizations this time Thanks in advance! Tim I have...
8
by: Colin Cashman | last post by:
In a program I'm writing, I have a class that generates a certain event. However, there may be dozens or even hundreds of instances of this particular class, which makes adding and removing...
4
by: Ben | last post by:
Hello everybody I got confused by this problem for which I don't have a logical explanation. There is a Thread (ThreadA) which receives Events from another system thread (ThreadS). ThreadA then...
1
by: vasant63 | last post by:
Hi, This is the compilation errors which I am getting when I compiling the code with VC++ 6.0. The same code is getting compiled in Linux OS. I would like to know how this compiler error can be...
7
by: deste | last post by:
Hi folks! I've got a problem with javascript and DOM. I want to create a simple "intelligent" <table>, inside a data-form. I'd like to do: - Change color of any <tron onMouseOver DOM event; -...
5
by: Chris | last post by:
I was having problems using my local IIS to display asp.net pages, or any pages for that matter. I actually reinstalled IIS and then uninstalled the ..net framework and reinstalled it. All pages...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.