Our not to be changed datalayer returns the DateTime.Mindate when the record's column has a NULL value.
So when you put a null value in a record's column and you read it again, you get 01-01-0001.
When binding this value to a DevExpress.XtraEditors.TextEdit control this value (01-01-0001) ofcourse is displayed in the control.
Now we want to show the control as being empty (no content), but i don't know how to achieve that.
I did find out that you can set a custom display text for the control when the object's attribute is NULL, but that doesn't work ofcourse because the value is 01-01-0001 and not null.
So in short: if it's a date with the value of 01-01-0001, show nothing in the control, otherwise, show the date.
Any ideas?
You could use a DateEdit control instead of a TextEdit
Set the NullDate property to 1-1-0001
Turn off the drop down button in the "Buttons" settings if you do not require it. It will then look just like a TextEdit.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With