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

Detect SelectionChanged event when the process of selecting dates is finished

1 Answer 55 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 18 Sep 2012, 07:01 PM
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.

BP

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 21 Sep 2012, 09:48 AM
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.

Greetings,
Vladi
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.

Tags
Calendar
Asked by
Brian
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or