VisualHint
2007-04-19 18:28:33 UTC
Hi,
Let's say that in my own custom control (derived from Control), I have
a property Value of type object. My goal is to store in this property
a DateTime or null. In order to store and edit a DateTime, I assign to
it the DateTimeConverter and DateTimeEditor attributes. All is fine at
runtime. However at design time, when I set an empty string in the
PropertyGrid (which is accepted by the grid), the serializer refuses
to write something like:
myControl.Value = null;
Instead it writes:
myControl.Value = new System.DateTime(((long)(0)));
Am I obliged to write my own serializer or is there something else I
can do ?
Thank you for your help
Nicolas
Let's say that in my own custom control (derived from Control), I have
a property Value of type object. My goal is to store in this property
a DateTime or null. In order to store and edit a DateTime, I assign to
it the DateTimeConverter and DateTimeEditor attributes. All is fine at
runtime. However at design time, when I set an empty string in the
PropertyGrid (which is accepted by the grid), the serializer refuses
to write something like:
myControl.Value = null;
Instead it writes:
myControl.Value = new System.DateTime(((long)(0)));
Am I obliged to write my own serializer or is there something else I
can do ?
Thank you for your help
Nicolas