Bug: SelectableDateStart not adhered to upon entry

16 posts, 0 answers
  1. Kevin
    Kevin avatar
    31 posts
    Member since:
    Jan 2009

    Posted 27 Jul 2010 Link to this post

    If I set the SelectableDateStart to be say '10/27/2010', I cannot select a date earlier to this but I can type one in (example 10/26/2010).
  2. George
    Admin
    George avatar
    1332 posts

    Posted 30 Jul 2010 Link to this post

    Hello Kevin,

    Thank you for contacting us.

    We are aware of this behavior of RadDateTimePicker and this is its default behavior. It's logged as feature request in our Public Issue Tracking System (PITS) and you can affect its priority by voting for it. The more clients' requests we receive the sooner we'll include it in our development plans. You can track this progress in our PITS with Issue ID = 2911.

    Please do not hesitate to contact us if you require any further information.

    Kind regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Kevin
    Kevin avatar
    31 posts
    Member since:
    Jan 2009

    Posted 30 Jul 2010 Link to this post

    If I do not want a user to be able to select a date prior to a certain one, why would I want them to be able to manually enter one?  I do not see how this default behavior is justified.  Perhaps you can suggest a scenario where this is the desired functionality?
  4. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 06 Aug 2010 Link to this post

    I agree with Kevin. Sure we can add code behind when the value changes and test if its between the selectable dates but not sure why we have to.
  5. George
    Admin
    George avatar
    1332 posts

    Posted 11 Aug 2010 Link to this post

    Hello Tyree,

    If we receive more common clients' requests we will include it in our further release.

    All the best,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Jeffrey
    Jeffrey avatar
    2 posts
    Member since:
    Jan 2009

    Posted 01 Feb 2011 Link to this post

    I too am complaining. It's very frustrating when you include properties that are supposed to alter functionality and they do nothing.  
  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 02 Feb 2011 Link to this post

    Hello Tyree,

    We are aware of the particular lack of functionality and  trying to resolve it as early as possible.

    Greetings,
    Kaloyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  8. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 21 Mar 2011 Link to this post

    Is this in Q1?
  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 24 Mar 2011 Link to this post

    Hi Tyree,

    We haven't managed to include the fix in the Q1 bits. Hope it will be ready for some of the upcoming service packs. Please accept our apologies once again.

    All the best,
    Kaloyan
    the Telerik team
  10. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 01 Feb 2012 Link to this post

    This is still not fixed?

    DisplayDateStart="{Binding Path=Today}" SelectableDateStart="{Binding Path=Today}"
    
  11. Yana
    Admin
    Yana avatar
    4579 posts

    Posted 06 Feb 2012 Link to this post

    Hello Adam,

    I am afraid that this fix was delayed due to more urgent tasks. At the moment we cannot specify a timeframe for implementing this change.  We are sorry for the inconvenience.

    I would suggest to use ParseDateTimeValue event to check the entered in the input date.

    Greetings,
    Yana
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  12. Steven
    Steven avatar
    9 posts
    Member since:
    Jan 2012

    Posted 16 Aug 2012 Link to this post

    Any idea when this bug might be fixed? It really doesn't make sense to have keyboard entered dates ignore the selectable date criteria.

  13. Steven
    Steven avatar
    9 posts
    Member since:
    Jan 2012

    Posted 16 Aug 2012 Link to this post

    I wrote the following attached behavior to fix the problem with keyboard entered dates. 

    Just set RadDateTimePicker.KeyableDateStart and/or RadDateTimePicker.KeyableDateEnd

    To customize the error message - set ErrorTooltipContent to your own custom message.

    /// <summary>
    /// Adds ability to restrict the text entered date of a RadDateTimePicker or RadDatePicker.
    /// </summary>
    public static class RadDateTimePicker
    {
        public static DateTime? GetKeyableDateStart(DependencyObject sender)
        {
            return (DateTime?) sender.GetValue(KeyableDateStartProperty);
        }
     
        public static void SetKeyableDateStart(DependencyObject sender, DateTime? value)
        {
            sender.SetValue(KeyableDateStartProperty, value);
        }
     
        public static DateTime? GetKeyableDateEnd(DependencyObject sender)
        {
            return (DateTime?) sender.GetValue(KeyableDateEndProperty);
        }
     
        public static void SetKeyableDateEnd(DependencyObject sender, DateTime? value)
        {
            sender.SetValue(KeyableDateEndProperty, value);
        }
     
        private static void OnKeyableDateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.OldValue == e.NewValue)
                return;
     
            var datePicker = sender as Telerik.Windows.Controls.RadDateTimePicker;
            if (datePicker == null)
                return;
     
            datePicker.ParseDateTimeValue -= OnParseDateTimeValue;
            datePicker.ParseDateTimeValue += OnParseDateTimeValue;
        }
     
        private static void OnParseDateTimeValue(object sender, ParseDateTimeEventArgs e)
        {
            var datePicker = sender as Telerik.Windows.Controls.RadDateTimePicker;
            if (datePicker == null)
                return;
     
            var startDate = GetKeyableDateStart(datePicker);
            if (startDate != null && e.Result < startDate)
                e.IsParsingSuccessful = false;
     
            var endDate = GetKeyableDateEnd(datePicker);
            if (endDate != null && e.Result > endDate)
                e.IsParsingSuccessful = false;
        }
     
        public static readonly DependencyProperty KeyableDateStartProperty = DependencyProperty.RegisterAttached("KeyableDateStart", typeof(DateTime?), typeof(RadDateTimePicker), new PropertyMetadata(OnKeyableDateChanged));
     
        public static readonly DependencyProperty KeyableDateEndProperty = DependencyProperty.RegisterAttached("KeyableDateEnd", typeof(DateTime?), typeof(RadDateTimePicker), new PropertyMetadata(OnKeyableDateChanged));
    }
  14. Alexander
    Alexander avatar
    11 posts
    Member since:
    Aug 2011

    Posted 08 Oct 2012 Link to this post

    Bug is also present when DateSelectionMode.Month or DateSelectionMode.Year is used.
  15. Kiti
    Kiti avatar
    9 posts
    Member since:
    Jul 2011

    Posted 11 Oct 2013 Link to this post

    Is this bug fixed??

    I need to implement the same feature in my project. Can you please give an update?
  16. Yana
    Admin
    Yana avatar
    4579 posts

    Posted 16 Oct 2013 Link to this post

    Hello Kiti,

    This feature is still not implemented, you can track its progress and vote in our PITS here.

    Also I would suggest to check this Code Library  for a possible solution how to restrict the entered in the DateTimePicker date.

    I hope this helps.

    Regards,
    Yana
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top