DateTimePicker NullText Example Request

2 posts, 0 answers
  1. NorthGates
    NorthGates avatar
    13 posts
    Member since:
    Oct 2012

    Posted 26 Feb 2013 Link to this post

    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
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 01 Mar 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top