Allow Date Range Selection Only

4 posts, 0 answers
  1. Brendan Enrick
    Brendan Enrick avatar
    28 posts
    Member since:
    Jul 2009

    Posted 28 Sep 2009 Link to this post

    Hello,

    I am using the calendar control and want my users to select a date range. In other words I want them to be able to click and drag or use the shift selection to select a date range. I've got this working for me. However, I want to disable the ability to Ctrl click and select individual (non-range) sets of dates.

    This image should help explain what I am looking for. It shows what I want to allow in the calendar and what I do not want to allow.
    http://img16.imageshack.us/img16/7870/telerikcalendardatesele.png

    Thanks,
    Brendan
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 30 Sep 2009 Link to this post

    Hi Brendan Enrick,

    It is not possible to achieve this with the current version of the RadCalendar. We will consider it as a feature request and we will try to add it in one of our forthcoming releases of the control. If you have any other questions don't hesitate to contact us.

    Best wishes,
    Kaloyan
    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.
  3. DevCraft banner
  4. Jeff
    Jeff avatar
    5 posts
    Member since:
    Nov 2010

    Posted 08 Dec 2010 Link to this post

    Any word on support for disabling the Ctrl+Click selection from the Multiple select mode?
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 10 Dec 2010 Link to this post

    Hi Jeff,

    We will consider adding such a feature to the control capability. As for now try the following code in your project when a SeletionChanged event is thrown from the RadCalendar:

    private void RadCalendar_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
            {
                var isCtrlPreseed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;
                if (isCtrlPreseed && calendar.SelectedDates.Count > 0)
                {
                    Dispatcher.BeginInvoke(() => calendar.SelectedDates.Clear());
                }
            }


    Kind regards,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top