Hi,
[quoted text, click to view] "Wouter de Kort" <WouterdeKort@discussions.microsoft.com> wrote in message
news:D89246C6-5B17-4B46-972D-9B4FB8E1BF60@microsoft.com...
> 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.
>
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] > 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?
>