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

RadCalender ability to click an event?

1 Answer 10 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 25 Aug 2016, 10:11 AM

Hi Guys

I am working on a universal app, my requirement is load the events to the calendar and have the ability to go to do a task when the user click a particular event.

I have looked through the documentation but could not see help on this. Does this control support this functionality?

If yes, can you provide a sample?

 

Thanks

Ramesh

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 25 Aug 2016, 06:12 PM
Hello Ramesh,

There is a SelectionChanged event and also a CellTap command, depending on whether you want an MVVM scenario or code-behind scenario.

As an example, I'll use the SelectionChanged event (you can find how to use the CellTap command here).

Note: Events is the DataSource that is bound to the Calendar:

ObservableCollection<EventInfo> Events => new ObservableCollection<EventInfo>()
{
    new EventInfo() {Date = DateTime.Today.AddDays(2), Title = "Some Event", Details = "Some Details..."},
    new EventInfo() { Date = DateTime.Today.AddDays(3), Title = "Other Event", Details = "Other Details..." }
};
 
private void RadCalendar_OnSelectionChanged(object sender, CurrentSelectionChangedEventArgs e)
{
     var selectedDate = e.NewSelection;
     IEnumerable<EventInfo> eventsOnTheSelectedDay = Events.Where(evnt => evnt.Date == selectedDate);
}


You now have all the events, or tasks, that are listed on the selected day on the calendar in eventsOnTheSelectedDay.

Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Calendar
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or