NullableDateTimePicker

Thread is closed for posting
6 posts, 0 answers
  1. B6B0BF88-AE8B-424C-B71F-0F09B7330C0E
    B6B0BF88-AE8B-424C-B71F-0F09B7330C0E avatar
    1336 posts
    Member since:
    May 2010

    Posted 01 Mar 2011 Link to this post

    Requirements

    RadControls version 2010.3 10.1215
    .NET version 3.5 SP1
    Visual Studio version 2008, 2010
    programming language CS, VB

    As of Q2 2011, this project is no longer supported since the RadDateTimePicker control support null value out of the box: http://www.telerik.com/products/winforms/whats-new/release-history/q2-2011-version-2011-2-11-712.aspx

    PROJECT DESCRIPTION
    In the last few months i have seen a lot of requests on the forums for a ( bindable ) nullable date time picker.
    This project is meant as an extension of the RadDateTimePicker and uses the internal checkbox to specify if the selected value is null or if a date is selected.



  2. F11ADD2A-840D-4563-BD9F-564CF2DD488A
    F11ADD2A-840D-4563-BD9F-564CF2DD488A avatar
    2911 posts
    Member since:
    Apr 2022

    Posted 02 Mar 2011 Link to this post

    Hello Emanuel,

    Thank you for providing this sample for a Nullable RadDateTimePicker, I believe that out community would benefit from it.
     
    All the best,
    Stefan
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. B6B0BF88-AE8B-424C-B71F-0F09B7330C0E
    B6B0BF88-AE8B-424C-B71F-0F09B7330C0E avatar
    1336 posts
    Member since:
    May 2010

    Posted 02 Mar 2011 Link to this post

    Hello Stefan,

    Could you please move this project to the Editors Code library page?
    That way it would be easier to find.

    Best Regards,
    Emanuel Varga
  4. 907A8354-5E2E-4F69-95E6-B00F38D8C271
    907A8354-5E2E-4F69-95E6-B00F38D8C271 avatar
    1805 posts
    Member since:
    Jan 2017

    Posted 02 Mar 2011 Link to this post

    Hi Emanuel,

    This code library article has just been moved to the appropriate section.

    All the best,
    Nikolay
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. 441E9F8F-27F9-4E43-977B-163320275CD5
    441E9F8F-27F9-4E43-977B-163320275CD5 avatar
    9 posts
    Member since:
    Nov 2009

    Posted 03 Aug 2011 Link to this post

    I have come up with a solution that works for me when binding a plain RadDateTimePicker to a .net Binding Source. My full post is here. 
    http://www.telerik.com/community/forums/winforms/calendar-and-datetimepicker/raddatepicker-and-null-values.aspx#1747985

    By modifying the default control set up:
    • A Null value is translated in and out without error. 
    • Today's date is given focus when the calendar opens 
    • The display text is blank when users press delete, or a null is in the data source

    I Set the DataBinding NullValue to Today 12:00:01 AM :

    this.radDateTimePicker1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.tblClientBindingSource, "ClientSinceDate", true, System.Windows.Forms.DataSourceUpdateMode.OnValidation, System.DateTime.Now.Date.AddSeconds(1), ""));

    Then I set the DateTimePicker NullDate to Today 12:00:01 AM,  and Value to Today 12:00:00 AM. 

    this.radDateTimePicker1.NullDate = System.DateTime.Now.Date.AddSeconds(1);
    this.radDateTimePicker1.NullText = "";
    this.radDateTimePicker1.Value = System.DateTime.Now.Date;

  6. 080FE80A-E8C8-4050-8996-FA698BBA8A6C
    080FE80A-E8C8-4050-8996-FA698BBA8A6C avatar
    1160 posts
    Member since:
    Jul 2017

    Posted 09 Aug 2011 Link to this post

    Hi Hartley,

    Thank you for sharing your solution with the community.

    I would like to inform you that in Q2 2011 we provided support for Null Value in RadDateTime/RadMaskedEditBox. So the following code should show an empty DateTimePicker:

    this.radDateTimePicker1.NullText = "";
    this.radDateTimePicker1.NullableValue = null;

    Best wishes,
    Peter
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.