StrataFrame Forum

NULL value for Datetime

http://forum.strataframe.net/Topic6919.aspx

By Chan - 2/17/2007

Hi,

I have an optional datatime field. I want this field to be NULL (  /  /   ) if user didn't specify any value to it. Currently, when I click new button, this datetime field defaulted to 01/01/1800.

Any ideas?

By StrataFrame Team - 2/19/2007

On the DataTimePicker control, you will need to set the ClearOnNull property to True and set the NullReplacementValue to 01/01/1800.  Then, the control will be cleared when it is bound to a field with a value of 01/01/1800
By Chan - 2/19/2007

Hi,

I want to display it as empty date, instead of '01/01/1800'.

BTW, I am using DevExpress DateEdit control. Anyhow, I want my BO to save datetime field as NULL if it is not specified. I don;t want it to be replaced as '01/01/1800'.

Any ideas?

By Trent L. Taylor - 2/19/2007

The DevExpress date control behaves slightly different than the standard control.  We just added this functionality for our standard date time control but this has not been implemented on the DevExpress date control.  You can drop on the new SF date time control temporarily just to see if this is the behavior you are looking for.