Weird data binding

adriaan

Member
Joined
Feb 28, 2005
Messages
13
Programming Experience
5-10
Hi

I have an address control with properties Line1, Line2, Line3 and Code, with that I have a Address Class with the same properties.

On my form I am doing the following to bind the class to my address control

AddressControl1.DataBindings.Add("Line1", clsPostalAddress, "Line1")
AddressControl1.DataBindings.Add("Line2", clsPostalAddress, "Line2")
AddressControl1.DataBindings.Add("Line3", clsPostalAddress, "Line3")
AddressControl1.DataBindings.Add("Code", clsPostalAddress, "Code")

When I leave my Address control, the bindings kick into actions, but It throws away my Line2, Line3 and Code values and also clears those text boxes in my control.

I actually put some debug.writeline statements inside the properties of the AddressControl and find that it fires them very strangely:

AddressControl: Get Line 1
AddressControl: Set Line 1
AddressClass: Get Line 1
AddressClass: Set Line 1
AddressControl: Set Line 1
AddressClass: Get Line 2
AddressControl: Set Line 2

Why is it getting the Line2 first from the class rather than from the AddressControl? because that is why my values are going missing.

Any suggestions?
 
Back
Top