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

Bug: SelectableDateStart not adhered to upon entry

15 Answers 110 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 27 Jul 2010, 04:39 PM
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).

15 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 30 Jul 2010, 10:25 AM
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
0
Kevin
Top achievements
Rank 1
answered on 30 Jul 2010, 03:47 PM
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?
0
Tyree
Top achievements
Rank 2
answered on 06 Aug 2010, 02:08 PM
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.
0
George
Telerik team
answered on 11 Aug 2010, 12:42 PM
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
0
Jeffrey
Top achievements
Rank 1
answered on 01 Feb 2011, 02:02 PM
I too am complaining. It's very frustrating when you include properties that are supposed to alter functionality and they do nothing.  
0
Kaloyan
Telerik team
answered on 02 Feb 2011, 09:43 AM
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>>
0
Tyree
Top achievements
Rank 2
answered on 21 Mar 2011, 06:33 PM
Is this in Q1?
0
Kaloyan
Telerik team
answered on 24 Mar 2011, 09:05 AM
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
0
Adam
Top achievements
Rank 1
answered on 01 Feb 2012, 07:43 PM
This is still not fixed?

DisplayDateStart="{Binding Path=Today}" SelectableDateStart="{Binding Path=Today}"
0
Yana
Telerik team
answered on 06 Feb 2012, 12:52 PM
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 >>
0
Steven
Top achievements
Rank 1
answered on 16 Aug 2012, 11:44 PM
Any idea when this bug might be fixed? It really doesn't make sense to have keyboard entered dates ignore the selectable date criteria.

0
Steven
Top achievements
Rank 1
answered on 17 Aug 2012, 04:52 AM
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));
}
0
Alexander
Top achievements
Rank 1
answered on 08 Oct 2012, 11:34 AM
Bug is also present when DateSelectionMode.Month or DateSelectionMode.Year is used.
0
Kiti
Top achievements
Rank 1
answered on 11 Oct 2013, 10:40 AM
Is this bug fixed??

I need to implement the same feature in my project. Can you please give an update?
0
Yana
Telerik team
answered on 16 Oct 2013, 09:53 AM
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 >>
Tags
DatePicker
Asked by
Kevin
Top achievements
Rank 1
Answers by
George
Telerik team
Kevin
Top achievements
Rank 1
Tyree
Top achievements
Rank 2
Jeffrey
Top achievements
Rank 1
Kaloyan
Telerik team
Adam
Top achievements
Rank 1
Yana
Telerik team
Steven
Top achievements
Rank 1
Alexander
Top achievements
Rank 1
Kiti
Top achievements
Rank 1
Share this question
or