Groups | Blog | Home
all groups > dotnet windows forms databinding > november 2006 >

dotnet windows forms databinding : Nested property keeps value on new


Wouter de Kort
11/10/2006 6:14:02 AM
Hi all :)

I've got a strange binding problem that I can't seem to solve.

I've got the following structure: Customer.ContactData.EmailAddress
where Customer and ContactData are classes and EmailAddress is a string.

When I bind a simple textbox to ContactData.EmailAddress and I click new on
the bindingnavigator the emailaddress keeps the previous value. When I remove
this value on the new object I can't leave the field and the program hangs.

There are also other fields and objects in the ContactData class that are
working like website(string) and TelephoneNumber(class). They are working
correct.

The databinding code is automatically generated by the IDE. I've tried to
change some of the values(like disabling formatting) but that's not helping.

I'm using VS 2005, C# and NHibernate.

What could be the problem?
Bart Mermuys
11/10/2006 10:46:25 PM
Hi,

[quoted text, click to view]

Yeah that's strange, you're saying you have both
Customer.ContactData.EmailAddress and Customer.ContactData.Website bound at
the same time on the same Form, but EmailAddress doesn't work properly.

If so, then something must be different for EmailAddress...

If EmailAddress property-get throws an exception then it won't clear the
field when you click new.
If EmailAddress property-set throws an exception then it won't allow you to
leave the field (validating(cancel)).

Do you see any first-chance exceptions (Debug-Windows-Output) when clicking
the new button ? Are you doing any custom parsing, formatting for the
EmailAddress Binding ?


HTH,
Greetings


[quoted text, click to view]

Wouter de Kort
11/17/2006 5:30:01 AM
It's really strange but suddenly I can't reproduce the error anymore. Last
week I was completely stuck and now it's working... If I get the error again
I will check the things you mentioned.

Thnx for the info :)

Wouter

[quoted text, click to view]
AddThis Social Bookmark Button