DateTimePicker null issue

  • Thread starter Thread starter Zief
  • Start date Start date
Z

Zief

Hi,

Does no-one else find it rediculous that something which should be so
simple as not having a date/time set, has been left out of the
DateTimePicker control!? Not only this, but there is no easy workaround
other than involving 'special dates' that can act as the null value,
and even these are not easy.
Are there plans to update this control? Are there controls available
that enable null dates?

I have been sent some code from someone on these groups for getting
around the issue using a special date, unfortunately his control
doesn't implement custom formatting and it looks very complex to add
this in, so I'm hoping someone can help me out somewhere?

Thanks,
Zief
 
I'm sure a big part of this is the fact that DateTime is a struct (value
type) and cannot be null. Why do you need a null value in the control?

I have not tried this, so I'm not totally sure if it will work correctly.
You could create a subclass of DateTimePicker and add that functionality
yourself. That shouldn't be too hard to do (in theory).

Hope that helps.

--Bryan
 
Back
Top