CalendarPopup and Invalid Dates (< MinDate or > MaxDate)

6 posts, 0 answers
  1. renemt
    renemt avatar
    40 posts
    Member since:
    Jul 2007

    Posted 13 Jan 2009 Link to this post

    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

  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 15 Jan 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. nick l
    nick l avatar
    1 posts
    Member since:
    Oct 2009

    Posted 20 Oct 2009 Link to this post

    Hello,
    Thank you for the answer. Re: question 1 in the original posting, are specifying invalid dates supported?
    Regards,
    Nick

  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 22 Oct 2009 Link to this post

    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.
  6. Sohel
    Sohel avatar
    3 posts
    Member since:
    Sep 2007

    Posted 03 Feb 2010 Link to this post

    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).
  7. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 04 Feb 2010 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready