This is a migrated thread and some comments may be shown as answers.

DateTimePicker NullText Example Request

1 Answer 62 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
NorthGates
Top achievements
Rank 1
NorthGates asked on 27 Feb 2013, 04:41 AM
Using Telerik v2013.1.220.40

I have tried pretty much everything but can't seem to succeed with this seemingly simple task.

I have 2 DateTimePicker, one for startDate and one for endDate.

I want to use the NullText "Start Date" and "End Date" respectively.

Now,
- When I put the date 1900-01-01 in startDate, the NullText "Start Date" should shows.
- When I put the date 2199-01-01 in endDate, the NullText "End Date" should show.

I don't have a problem with startDate control, but the endDate control always use the lowest date instead of my 2199-01-01.

Please provide a solid sample that works

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 01 Mar 2013, 03:40 PM
Hello Luc,

Thank you for writing.

I was able to see the "Start Date" text when I put the 1900-01-01 and "End Date" when I set the 2199-01-01 in the second DateTimePicker - please, refer to the attached video.

I have set the following properties for the controls:
// startDateTimePicker
//            
this.startDateTimePicker.MinDate = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);           
this.startDateTimePicker.NullDate = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
this.startDateTimePicker.NullText = "Start Date";           
//
// endDateTimePicker
//
this.endDateTimePicker.MaxDate = new System.DateTime(2199, 1, 1, 0, 0, 0, 0);
this.endDateTimePicker.NullDate = new System.DateTime(2199, 1, 1, 0, 0, 0, 0);
this.endDateTimePicker.NullText = "End Date";

Please, refer to my test project.

I hope this helps.

All the best,
Peter
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

Interested, but can’t attend? Register anyway and we’ll send you the recording.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
NorthGates
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or