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

CalendarPopup and Invalid Dates (< MinDate or > MaxDate)

5 Answers 121 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
renemt
Top achievements
Rank 2
renemt asked on 13 Jan 2009, 04:10 PM
I'm using RadControls for WinForms 2008.3 1204.

Assume the following: I have a DateTimePicker and set the MinDate and MaxDate properties.

1. Is it possible to show the "invalid dates", means all dates not between MinDate and MaxDate, in the calendar popup with a certain format, for example strike out or red?

2. Is it possible to prevent the closing of the calendar popup, if no valid date has been selected? Although I can listen to the DateTimePicker's Closing event I don't see how to determine which date has been selected in the calendar popup.

3. If I don't prevent closing the popup (like at the moment) and the user did select an invalid date which has not been applied to the DateTimePicker, the date even stays selected in the calendar popup if I re-open it. Let's say the DateTimePicker's MinDate is set to 2009/01/10. I open the calendar popup and select 2009/01/01. The value will not be applied when the popup closes. But when I re-open it, 2009/01/01 is still shown as selected.

Any helpful hints?

Regards,
ReneMT

5 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 15 Jan 2009, 01:38 PM
Hello renemt,

Thank you for contacting us.

To get more options about the popup and the calendar use the GetCurrentBehavior() method in RadDateTimePickerElement. Then you can cast the current behavior to RadDateTimePickerCalendar and you will have access to the calendar using the Calendar property or to the popup using the PopupControl property.

You can call ShowDropDown() if you want to manually open the popup. At the moment, the popup closes when a selection is made and the SelectionChanged event is fired. RadCalendar has also an event called SelectionChanging and I think you may cancel the selection there and this will prevent popup control from closing.

Please contact me back if you have more questions.

Kind regards,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
nick l
Top achievements
Rank 1
answered on 20 Oct 2009, 10:33 AM
Hello,
Thank you for the answer. Re: question 1 in the original posting, are specifying invalid dates supported?
Regards,
Nick

0
Boyko Markov
Telerik team
answered on 22 Oct 2009, 02:11 PM
Hello nick l,

No, it is not possible in this version of RadCalendar. The navigation is also disabled when you want to navigate to a view which has invalid dates( dates not in the MinDate - MaxDate range).

Please do not hesitate to contact us again if you have more questions.

Greetings,
Boyko Markov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sohel
Top achievements
Rank 1
answered on 03 Feb 2010, 07:12 PM
Is there an easy way to determine whether an invalid date has been selected? This is for ASP.NET AJAX RadDateTimePicker control.
I just need to know if the user has selected an invalid date (i.e the control text is red).
0
Nikolay
Telerik team
answered on 04 Feb 2010, 07:55 AM
Hello Sohel,

I would suggest that you ask your question in the appropriate Telerik ASP.NET AJAX forum section. This will allow the users who are interested in the same topic to find the necessary information more easily.
In addition, any confusion about the technology discussed in the current thread will be avoided. Thank you for your understanding.

Best wishes,
Nikolay
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
renemt
Top achievements
Rank 2
Answers by
Boyko Markov
Telerik team
nick l
Top achievements
Rank 1
Sohel
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or