469,928 Members | 1,691 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,928 developers. It's quick & easy.

Representing Null with a DateTimePicker

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
4 3061
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


"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
<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
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.

Similar topics

1 post views Thread by Dean L. Howen | last post: by
6 posts views Thread by John Smith | last post: by
7 posts views Thread by JJ | last post: by
reply views Thread by Bernie Yaeger | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.