Multimobile Development: Building Applications for any Smartphone
2nd Attempt: Null Dates in DateTimePicker Control
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.compactframework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Bruce Vander Werf
I am looking for a DateTimePicker control that handles null dates.
This is needed in the case where a date has not yet been specified
(e.g. in a database) and you want to indicate and maintain that state.

Is it possible to specify a null date in the DateTimePicker control
written by Ralph Arvesen from smartdevices.microsoftdev.com site?

If this is not possible, is there a similar control that will allow
this functionality?

Thanks...

--Bruce

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Mark Johnson
I use the DateTimePicker.cs offered on a Microsoft site for Compact and
Internationalised
it to support First Day of Week and Date Formating accourding to culture.
This as been testest on the Emulator for all supported Cultures (even
Swahli).
The Name of the Day of Week and Month are recieved from the Maschine but
what
the first Day of Week is and "Today" is must be manuly set.

As to a null Date, the Control must recieve a valid DateTime value as indeed
the DataBase needs.
For this I used 01.01.1900 as a start Date to show that the User does not
want to set the Date
(i.e. Treatment begin, when there is none).

I found no other workaround. Sorry.

Mark Johnson, Berlin Germany
Click here to reveal e-mail address

"Bruce Vander Werf" <Click here to reveal e-mail address> schrieb im Newsbeitrag
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
First volume of Multimobile Development nearly ready to go to press
A mention on Developing for the iPhone and Android: The pros and cons
 
    
Jared Miniman [MVP] (VIP)
Are you somehow binding the DateTimePicker to a DataSet? Otherwise, I see
no reason why you couldn't set the control to DateTime.Min and then either
handle the logic to set this to null in your database or store it as
DateTime.Min, realizing this is a null entry?

--
_________________________________
Jared Miniman, MS-MVP Mobile Devices
Mobile Computer Consultant

ActiveSync problems?
http://www.microsoft.com/mobile/pocketpc/support/help/activesync.asp
Connection Mngr Q's?
http://www.microsoft.com/mobile/pocketpc/tutorials/connectionmanager

"Bruce Vander Werf" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Bruce Vander Werf
Not binding to a DataSet, but I am setting the value of the control to
a value in a DataSet.

I am doing as you suggest, however, the control does display the
minimum date. I would like the date to display empty when there is a
null or unspecified date.

--Bruce

On Fri, 12 Dec 2003 16:12:57 -0500, "Jared Miniman [MVP]"
<Click here to reveal e-mail address> wrote:

[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
First chapters of Multimobile Development book now available on Apress Alpha program
iPad
 
    
khorad
"Bruce Vander Werf" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

well i have a textbox and if there is a null date the value is blank

then if the user clicks it the date picker pops up with the default value
(current date)

currently once the picker pops there is no way to return without selecting a
date, but i suppose you could extend the control to include a cancel and/or
clear button

in which case the popup would return an empty string to the textbox and you
preserve your null date

(just to be clear, i don't use the DateTimePicker class, only the
DayPickerPopup class)

Reply to this message...
Vote that this is a GOOD answer...
 
New book project – Multimobile Development: Building Applications for any Smartphone
Dive into HTML5
 
 
System.Data.DataSet
System.DateTime
System.Windows.Forms.DateTimePicker




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734