By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,069 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,069 IT Pros & Developers. It's quick & easy.

Representing Null with a DateTimePicker

P: n/a
Hello:

We were hoping to allow users to have DateTimePicker value null so
that a unused date is stored on a Database. Does the control support
this? I am pretty sure it doesn't.

How would you go about representing this to a user so they are not
confused?

Thanks,
Travis
Nov 27 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Travis,

This is one of the things that absolutely sucks about the DateTimePicker
control, IMO. To get around this, I usually have a checkbox that
enables/disables the control, and then if the checkbox is not checked, I
consider it a null value.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<je**********@gmail.comwrote in message
news:42**********************************@i12g2000 prf.googlegroups.com...
Hello:

We were hoping to allow users to have DateTimePicker value null so
that a unused date is stored on a Database. Does the control support
this? I am pretty sure it doesn't.

How would you go about representing this to a user so they are not
confused?

Thanks,
Travis

Nov 27 '07 #2

P: n/a


"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:OB**************@TK2MSFTNGP02.phx.gbl...
Travis,

This is one of the things that absolutely sucks about the
DateTimePicker control, IMO. To get around this, I usually have a
checkbox that enables/disables the control, and then if the checkbox is
not checked, I consider it a null value.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<je**********@gmail.comwrote in message
news:42**********************************@i12g2000 prf.googlegroups.com...
>Hello:

We were hoping to allow users to have DateTimePicker value null so
that a unused date is stored on a Database. Does the control support
this? I am pretty sure it doesn't.

How would you go about representing this to a user so they are not
confused?

Thanks,
Travis

I agree with Nicholas...the DateTimePicker sucks :) So we wrote our own.
That was how we got around it. Now, the DateTimePicker is in the form of a
drop-down with a textbox that stores the users selection. They may also
enter the date in manually instead of selecting the dropdown from the
calendar...(if you implement your own, you may be able to use the existing
DateTimePicker control in the drop-down window if you wish, but only
"select" the date if the user actually clicks on a date).

HTH,
Mythran
Nov 27 '07 #3

P: n/a
<je**********@gmail.comskrev i meddelelsen
news:42**********************************@i12g2000 prf.googlegroups.com...
Hello:

We were hoping to allow users to have DateTimePicker value null so
that a unused date is stored on a Database. Does the control support
this? I am pretty sure it doesn't.

How would you go about representing this to a user so they are not
confused?

Thanks,
Travis
Hi Travis

I find that silly to. I have found a control that works around this though.
I have translated it into VB at one time, but have since moved to C#. Below
is the link to the code. It even supports a text to be displayed when the
control value is null...

http://www.codeproject.com/cs/miscct...TimePicker.asp

I hope this helps you...

/Finn Stampe Mikkelsen
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary ant those who
don't.
Es gibt 10 arten von menschen. Die die binär verstehen bzw. die die es nicht
tuhen

Nov 27 '07 #4

P: n/a
Hello Travis,

I was using the MS DateTimePicker as an inplace control in Smart
PropertyGrid and among others needed the null value functionnality.
Whatever my effforts, even using some techniques found under
CodeProject there was always something not working to achieve the
level of quality I wanted. That's why I decided to create from scratch
a Field Pack Editor. If a commercial product is an option, I
definitely advise you to check it out. It fixes all the shortcomings
of the MS DateTimePicker, adds flexibility and usability, and this is
a true field editor, not a pseudo solution with a control derived from
the original DateTimePicker or with a textbox or masked textbox

Best regards,

Nicolas Cadilhac @ VisualHint (http://www.visualhint.com)
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
www.visualhint.com/index.php/fieldpackeditor)
Home of Smart PropertyGrid for .Net and MFC (http://www.visualhint.com/
index.php/propertygrid)
Microsoft PropertyGrid Resource List - http://www.propertygridresourcelist.com


On Nov 27, 10:10 am, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
Hello:

We were hoping to allow users to haveDateTimePickervalue null so
that a unused date is stored on a Database. Does the control support
this? I am pretty sure it doesn't.

How would you go about representing this to a user so they are not
confused?

Thanks,
Travis
Nov 28 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.