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

Get all appointments for a specific date

1 Answer 90 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
T
Top achievements
Rank 1
T asked on 10 Mar 2017, 02:31 PM

How can this be done without looping over all the appointments in the appointments collection? Is there a method like "GetAppointmentsInRange"?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Mar 2017, 01:56 PM
Hello Tom,

Thank you for writing.  

It is appropriate to use the multiday view which shows multiple date-time intervals with appointments arranged one next to another. The SchedulerMultiDayView provides the public GetAppointmentsInInterval method which returns a List of the appointments in the specified interval. Here is a sample code snippet:
public RadForm1()
{
    InitializeComponent();
 
    SchedulerMultiDayView multiDayView = new SchedulerMultiDayView();
    DateTime startDate = DateTime.Today;
    multiDayView.Intervals.Add(startDate, 2);
    multiDayView.Intervals.Add(startDate.AddDays(4), 3);
    this.radScheduler1.ActiveView = multiDayView;
}
 
private void radButton1_Click(object sender, EventArgs e)
{
    SchedulerMultiDayView multiDayView = this.radScheduler1.ActiveView as SchedulerMultiDayView;
    DateTime start = DateTime.Today;
    DateTime end = DateTime.Today.AddDays(2);
    List<IEvent> appointments = multiDayView.GetAppointmentsInInterval(new DateTimeInterval(start, end));
}

For the other views, it is suitable to iterate the appointments and get which events belong to the specified time interval.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler and Reminder
Asked by
T
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or