3 Replies - 8320 Views - Last Post: 24 May 2011 - 11:16 AM Rate Topic: -----

#1 brainshark  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-May 11

DISPLAYING NULL VALUES IN A DATETIME PICKER CONTROL

Posted 23 May 2011 - 04:59 PM

I would like to be able to display null values in a datetime picker control.
I am using one datetime picker control for both datadisplay and data entry. when I load the data from the database and if there is no date then the datetime picker control must be blank.

Is there a way to accomplish this??

Many thanks
Is This A Good Question/Topic? 0
  • +

Replies To: DISPLAYING NULL VALUES IN A DATETIME PICKER CONTROL

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: DISPLAYING NULL VALUES IN A DATETIME PICKER CONTROL

Posted 23 May 2011 - 05:09 PM

Sorry, I've not found a way to do it but you could use a textbox and a calender control to build your own and allow blank entries.

Another thing I've done is set the default to 01/01/1900 and if that is what the date is at the time of storing, leave that field blank.

The only problem with this method is when you click to change the date you are a long way off from the current date making it not very user friendly. Not to mention, most uses would see that date and feel obligated to set it to something different.
Was This Post Helpful? 1
  • +
  • -

#3 brainshark  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-May 11

Re: DISPLAYING NULL VALUES IN A DATETIME PICKER CONTROL

Posted 23 May 2011 - 05:31 PM

View PostCharlieMay, on 23 May 2011 - 05:09 PM, said:

Sorry, I've not found a way to do it but you could use a textbox and a calender control to build your own and allow blank entries.

Another thing I've done is set the default to 01/01/1900 and if that is what the date is at the time of storing, leave that field blank.

The only problem with this method is when you click to change the date you are a long way off from the current date making it not very user friendly. Not to mention, most uses would see that date and feel obligated to set it to something different.


Thank you very much for your reply. I somehow knew that I will have to do the stuff myself just like you proposed. I was thinking about a trick to change the fontcolor to white (white over white)in the text area of the datetime picker control to simulate a blank date, but it seems that the fontcolor in the datepicker control cant change either...
Was This Post Helpful? 0
  • +
  • -

#4 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1819
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: DISPLAYING NULL VALUES IN A DATETIME PICKER CONTROL

Posted 24 May 2011 - 11:16 AM

You can look at this from The Code Project, it may help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1