Detect SelectionChanged event when the process of selecting dates is finished

2 posts, 0 answers
  1. Brian
    Brian avatar
    10 posts
    Member since:
    Jul 2012

    Posted 18 Sep 2012 Link to this post

    Is there a way to tell when the process of selecting a date range is complete with RadCalendar (SelectionMode Extended)? Right now, the SelectionChanged event is firing whenever dates are added or removed from SelectedDates as the user moves the mouse over the calendar, but I would like to do a time intensive process on the selected date range and it would not be appropriate to do so when the user is not finished selecting dates.

    I could put some kind of timer on it that would run after a set number of milliseconds, but if the user is still dragging on the calendar this would not work well. I am hoping there is a better solution, maybe I am missing something really obvious. Thanks.


  2. Vladi
    Vladi avatar
    749 posts

    Posted 21 Sep 2012 Link to this post

    Hi Brian,

    There isn't a build in event that could be used in the way you explained because there is no proper way to know exactly when the selection really is finished. You could use the KeyUp event and listen for the Ctrl and Shift keys.

    The next code snippet shows the described approach:
    private void RadCalendar_KeyUp(object sender, KeyEventArgs e)
        if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl || e.Key == Key.LeftShift || e.Key == Key.RightShift)
            var calendar = sender as RadCalendar;

    Hole this is helpful.

    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top