Are you subscribing to any events for this checkbox on your form,
such as CheckedChanged?
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: jwhook
[mailto:cslanet@lhotka.net]
Sent: Tuesday, October 07, 2008 7:02 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] Databound checkbox serialization error.
Additional information. Hoping someone can point out if I
can serialize, and where to do it.
The offending code producing the quoted error is:
Global.BindField(chkOverwriteTotal, "Checked",
m_FixtureCountCollection["6-B"], "NumberOfFixtures",
b_Format, b_Parse);
chkOverwriteTotal.DataBindings["Checked"].DataSourceUpdateMode =
DataSourceUpdateMode.OnPropertyChanged;
The first line uses some general code of ours for binding controls adapted from
Rocky's book. When I added the next line to get instant response on the check
box, the serialization error occurs. Note that it occurs at runtime when the
user actually clicks on the checkbox.
Once more, a plea for help.
Thanks.
Hmmm. I am afraid I do not have a good idea of why this
occurs. Could there be an issue with custom code you guys have? Could
you try to bind the checkbox manually just to test this theory?
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: jwhook
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 08, 2008 12:51 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Databound checkbox serialization error.
Yes. But I've tested without subscribing to any events. Same
problem.
You should be able to do something like just to test the
theory. I would recommend disabling CHeckedChanged event for
testing as well just to eliminate as many moving parts from test as possible.
chkOverwriteTotal.DataBindins.Add(“Checked”,
objectOrDataSource, “MyProperty”, null, DataSourceUpdateMode.OnPropertyChanged);
Serialization error typically occurs if you are attaching a non-serializable
object to your object graph, most commonly via an event.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: jwhook
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 08, 2008 2:07 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: Databound checkbox serialization error.
Hi Sergey.
I'll try to create a simplified version of what we're doing, but from your
response, I guess you're saying that, in theory, I should be able to do this
kind of thing:
chkOverwriteTotal.DataBindings["Checked"].DataSourceUpdateMode =
DataSourceUpdateMode.OnPropertyChanged;
without any problems, if I can get my code right.
As an alternative, I tried forcing the datasource to be updated during the
CheckedChange event using the DataBindings[indx].WriteValue() method, but it
triggers the same kind of serialization error.
- jim
Copyright (c) Marimer LLC