Forum  General Visual ...  How do I...?  display null dates in datetimepicker?
Previous Previous
 
Next Next
New Post 3/24/2009 1:21 AM
  sbruyneel
39 posts
No Ranking


display null dates in datetimepicker? 
Modified By sbruyneel  on 3/24/2009 3:22:20 AM)

Hi,
 
Is there a way to display null dates in a DateTimePicker? Maybe I can set a custom format when the DateTime value is null. How do I set the custom format to only show day? Maybe there is an easy solution. I tried Enabled=false but it still shows a date also tried to set forecolor=backcolor but that does not work.
Thanks,
Sander

 
New Post 3/24/2009 1:35 AM
  jayhobbs
1644 posts
1st Level Poster




Re: display null dates in datetimepicker? 

Hi Sander,

You should check this out

The NullableDateTimePicker class inherits from DateTimePicker.
The functionality is implemented via 2 new properties:  NullValue and AllowNullValues.
·         NullValue is an actual DateTime value that is used by the application to represent null. By default, this is set to 01/01/01, but can be changed programmatically.
·         AllowNullValues is a boolean which indicates whether or not null values are allowed.
http://www.visualwebgui.com/Developers/Resources/Codes/tabid/326/articleType/ArticleView/articleId/167/NullableDateTimePicker.aspx
I havent tried it so I have no detailed information
Cheers
 
Jay
 
 
New Post 3/24/2009 4:32 AM
  ori.cohen
4383 posts
1st Level Poster




Re: display null dates in datetimepicker? 

Hello Sander,

Please view this article here for details on how to only display day values in the DataTimePicker control using CustomFormat.

It may be very helpful if you could please describe to me what is it that you are trying to accomplish in the flow UI, and what is the scenario you are constructing in your application. It would greatly help me to see the bigger picture. I would be able to either, open an issue for required changes in our framework, or suggest to you the best implementation available to achieve what you want in your VWG application.

Regards,

Ori Cohen
Support Manager, the Visual WebGui team

 

 
New Post 3/24/2009 6:55 AM
  dubem1
1044 posts
1st Level Poster




Re: display null dates in datetimepicker? 

I have tried the NullableDateTimePicker  but there is no improvment over the standard DateTimePicker.  You still cannot display a null value.   The checkbox is still there and a date is always display.

Maybe I don't understand how to use it but I have play with the two new properties without any succes.  I don't know what's their utulility.

Martin

 
New Post 3/24/2009 9:23 AM
  osmosis311
383 posts
3rd Level Poster


Re: display null dates in datetimepicker? 

Hi Ori,

I can give you a business case as I am having the same problem as Martin, and I really need a DateTimePicker where I can display an empty box as opposed to a date.

I have a database application where users can search through records of Emergency Ambulance (hint Magen Dovid Adom) calls.  When they start the application, all the different search fields are blank, because it is showing all records by default.  This includes the filters for Start Date and End Date.  Right now, the only way I could think of to NOT search on these fields by default, was to set both of them to the next day (so if a user goes into the application today, the 24th, the DateTimePickers would show tomorrow's date, the 25th).   My application knows to ignore the dates in the search filter if they are greater than today's date.  But, if I had the ability to show an empty (null) value in the DateTimePicker, then I could just exclude them from the searches if they don't have a value. 

That would be a much more intuitive implementation from a user's perspective, as opposed to me having to explain to them why the date fields are set to tomorrow's date by default.

 

Thanks,

-Danny

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  display null dates in datetimepicker?
Assessment Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS