IndexOutOfRangeException is thrown when AllowParsingWithoutSeparator is set to true and an invalid date is entered.
Examples of invalid date strings that cause the exception:
There is no proper workaround, but the error is silently printed in the Output pane of Visual Studio and it doesn't break the application or the RadDatePicker control, so it can be ignored.
The exception stacktrace is the following:
System.ArgumentOutOfRangeException: Year must be between 1 and 9999. (Parameter 'year') at System.DateTime.DaysInMonth(Int32 year, Int32 month) at Telerik.Windows.Controls.MilitaryDateParser.CheckAndSetValidDate(Int32 year, Int32 month, Int32 date, DateTime& fullDate, DateTime current) at Telerik.Windows.Controls.MilitaryDateParser.TryParseSingleDigitDatePart(DateTime& result, DateTime current, String datePart, DayMonthYearIndecesInfo dateIndeces, CultureInfo culture) at Telerik.Windows.Controls.MilitaryDateParser.TryParse(String value, DateTime& result, DateTime current, CultureInfo culture) at Telerik.Windows.Controls.RadDateTimePicker.ParseDateTime(String text, IDateTimeParser parser, Nullable`1& dateTime) at Telerik.Windows.Controls.RadDateTimePicker.OnDateTimeTextChanged() at Telerik.Windows.Controls.RadDateTimePicker.OnDateTimeTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Telerik.Windows.Controls.RadDateTimePicker.set_DateTimeText(String value) at Telerik.Windows.Controls.RadDateTimePicker.UpdateValueFromCurrentText() at Telerik.Windows.Controls.RadDateTimePicker.ProcessKey(KeyEventArgs e) at Telerik.Windows.Controls.RadDateTimePicker.OnKeyDown(KeyEventArgs e)
I will be a great feature in RadDatePicker to choose formatting of date for example only by year or month and so on... - like in DatePicker for Windows 8 Xaml version.
When I have in the RadDatePicker some date value (ex. 1.1.2013) and I try to change only year so, that I use dropdown window. When I select Year (ex. 2012), it goes OK. But when I change same month as current selected date, it open date calendar on January 2013. If I make same, but change different month (ex. Feb) it open date calendar OK.