473,480 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Change events

I've been mucking around with databinding & I am seeing something I
can't explain...

I have a collection (PersonList) that inherits from CollectionBase and
implements IBindingList. It contains Person objects that implement
IEditableObject.

I have a windows form with three text boxes (last, first & middle name)
and next/prev navigation buttons. There are also two additional buttons
to programmatically change values in the first item in the list (these
are so that I can see what happens when the data is changed outside of
the form.)

The Person object supports LastNameChanged and FirstNameChanged events.
These events are fired from the appropriate property set method.

When I click on the button to programmatically change a single value in
the person at index 0, this is what I see:

FirstName property:set is called
FirstName property:get is called
LastName property:get is called
MiddleName property:get is called

Why are all of the bound values being refreshed in response to a change
in only one?

I see the corresponding behavior when I programmatically change the last
name.

I'm confused.

Any enlightenment will bee appreciated.

Thanks,
Bryan
Nov 15 '05 #1
2 1645

--
See
INFO: How databinding really works v3
http://www.freeweb.hu/noiseehc/databind.html

"Bryan Glennon" <br***@bpgc.com> wrote in message news:MP************************@msnews.microsoft.c om...
I've been mucking around with databinding & I am seeing something I
can't explain...

I have a collection (PersonList) that inherits from CollectionBase and
implements IBindingList. It contains Person objects that implement
IEditableObject.

I have a windows form with three text boxes (last, first & middle name)
and next/prev navigation buttons. There are also two additional buttons
to programmatically change values in the first item in the list (these
are so that I can see what happens when the data is changed outside of
the form.)

The Person object supports LastNameChanged and FirstNameChanged events.
These events are fired from the appropriate property set method.

When I click on the button to programmatically change a single value in
the person at index 0, this is what I see:

FirstName property:set is called
FirstName property:get is called
LastName property:get is called
MiddleName property:get is called

Why are all of the bound values being refreshed in response to a change
in only one?

I see the corresponding behavior when I programmatically change the last
name.

I'm confused.

Any enlightenment will bee appreciated.

Thanks,
Bryan

Nov 15 '05 #2
If your BindingManagerBase is a CurrencyManager then it is actually reliant
on the ListChangedEvent rather than the particular <PropertyName>Changed
events.

You will get a CurrencyManager if you're binding to an IBindingList.

"Bryan Glennon" <br***@bpgc.com> wrote in message
news:MP************************@msnews.microsoft.c om...
I've been mucking around with databinding & I am seeing something I
can't explain...

I have a collection (PersonList) that inherits from CollectionBase and
implements IBindingList. It contains Person objects that implement
IEditableObject.

I have a windows form with three text boxes (last, first & middle name)
and next/prev navigation buttons. There are also two additional buttons
to programmatically change values in the first item in the list (these
are so that I can see what happens when the data is changed outside of
the form.)

The Person object supports LastNameChanged and FirstNameChanged events.
These events are fired from the appropriate property set method.

When I click on the button to programmatically change a single value in
the person at index 0, this is what I see:

FirstName property:set is called
FirstName property:get is called
LastName property:get is called
MiddleName property:get is called

Why are all of the bound values being refreshed in response to a change
in only one?

I see the corresponding behavior when I programmatically change the last
name.

I'm confused.

Any enlightenment will bee appreciated.

Thanks,
Bryan

Nov 15 '05 #3

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

Similar topics

19
9393
by: Tom | last post by:
Hi, I have the following problem. I analyse data from a file. When I am done analysing all the data that was in that file, I want to let my program wait until this specific file has changed...
0
2715
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
1
2842
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
3
1301
by: 2obvious | last post by:
This is nice and simple: Below is a code example. On a PC, it works in IE6. It does not work in Netscapes 6 or 7. Why? <html><head> <script> function test() {...
2
4365
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
1
3754
by: Jimmer | last post by:
How do you recognize a change in the value of a calculated control? The normal events such as Dirty don't seem to work, unless I physically interact with the control in some way. My problem is...
0
1437
by: MS | last post by:
Is the schema used to validate XML Documentation Comments available to be changed by a VS.Net user? I suspect the this question is no so have a couple of requests: 1.) I use #region...
0
2475
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
3
1459
by: tc | last post by:
I'm trying to put together a small control. It's not, but for arguments sake, let's say it's a progress bar. The user will make a change to a setting, lets call it 'value'. I want to trap the...
0
7048
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
7091
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
5344
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,...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.