473,324 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 3264
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dean L. Howen | last post by:
Dear friends, Could you help me to solve the problem: How can we set/get NULL values of datetime in DatetimePicker ? I design a form using DateTimePicker to input/output date value, but the date...
6
by: John Smith | last post by:
Hey folks, I have a DateTimePicker control on my Windows Form. Whenever I either: a) Don't give it a value b) Set it's value to Null c) Set it's value to "" It makes the date today's date. ...
7
by: JJ | last post by:
Hi, What's the correct code for checking if a DateTime control is empty or not filled in with a date? Thanks, JJ
0
by: Bernie Yaeger | last post by:
How can I use a datetimepicker as the control for entry of, say, enddate, when enddate may be any date but also may be null (because the end hasn't been reached yet)? Also, can I set up a...
2
by: AA | last post by:
Do anyone know how to set null value to DateTimePicker control? I want to not displaying any date on the DateTimePicker, is it possible? Thx in advance! Richard
7
by: Pieter | last post by:
Hi, I'm looking for a DateTimePicker that supports 100% databinding (and support null-values)... It's a shame that the normal control doesn't, but when searching on the internet, I didn't find...
5
by: M Skabialka | last post by:
I am creating my first Visual Studio project, an inventory database. I have created a form and used written directions to add data from a table to the form using table adapters, data sets, etc. ...
2
by: Claes Wedin | last post by:
My customer needs a DateTimePicker in VS2005 C# that can show emty date values (blank/space/null). I need a control that: 1. Can show a blank value 2. Detete a date when hitting the delete...
0
by: tschroeder250 | last post by:
Hi Everyone, There are so many Nullable DateTimePickers out there that this post may not even be found among all the others, but I wanted to try. First, I want to thank all the authors of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.