473,746 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3299
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.co m

<je**********@g mail.comwrote in message
news:42******** *************** ***********@i12 g2000prf.google groups.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.c omwrote in
message news:OB******** ******@TK2MSFTN GP02.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.co m

<je**********@g mail.comwrote in message
news:42******** *************** ***********@i12 g2000prf.google groups.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**********@g mail.comskrev i meddelelsen
news:42******** *************** ***********@i12 g2000prf.google groups.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...@g mail.com" <jehugalea...@g mail.com>
wrote:
Hello:

We were hoping to allow users to haveDateTimePic kervalue 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
2433
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 could be NULL Thank you.
6
2345
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. I need it to be empty though. How do I make it empty? It represents a field in my database which legitimately can be null and so I can't show it
7
3856
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
1275
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 datetimepicker that will allow manual entry instead of a pick from the calendar, such that the user can simply enter '09/23/2004'? Thanks for any help. Bernie Yaeger
2
17207
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
2583
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 any solution that works without problems. Does anybody know where I can find an inherited DateTimePicker that supports databinding and nulll-values? Any links, sample code etc would be really appreciated! It can be for VB.NET 2005, in case that...
5
2709
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. I imported a table from an Access database which has some date fields. Many of these dates have never been filled in, so are nulls. If I look directly into the table data from Visual Studio it shows NULL. However, when I scroll from record to...
2
8195
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 and/or back key 3. Allowse the user to enter yyyy-MM-dd date format manually 4. When tabbed into the field behaves juast like a textbox
0
2600
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 code I used as a starting point. Second, I hope this code helps someone as much as they helped me. I have built a Nullable DateTimePicker and NullableCalendarColumn/Cell/EditingControl that is nearly 100% complete, as far as I can tell. There is...
0
8975
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8801
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9516
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9351
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8229
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6062
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4840
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2200
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.