Hi Michael,
Thank you for using Syncfusion products.
Your requirement can be achieved by checking the condition with ScheduleViewType startdate ,end date with appointment start and end date.
Please refer to the following code snippets :
protected void Page_Load(object sender, EventArgs e)
{
var startdate = DateTime.Now;
var enddate = DateTime.Now;
ScheduleWebAppointmentList arr = Schedule1.Appointments;
if (Schedule1.ScheduleType == ScheduleViewType.Week)
{
startdate = Schedule1.StartDate;
enddate = startdate.AddDays(7); // as it is week ,end date will be 7 days later
}
else if (Schedule1.ScheduleType == ScheduleViewType.Month)
{
startdate = Schedule1.StartDate;
enddate = startdate.AddMonths(1); // as it is week ,end date will be one month later
}
else if (Schedule1.ScheduleType == ScheduleViewType.Day)
{
startdate = Schedule1.StartDate;
enddate = startdate.AddDays(0);
}
else if (Schedule1.ScheduleType == ScheduleViewType.WorkWeek)
{
startdate = Schedule1.StartDate;
enddate = startdate.AddDays(5);
}
ArrayList currentViewAppointments = new ArrayList();
foreach (ScheduleWebAppointment obj in arr)
{
if (obj.StartTime >= startdate && obj.EndTime <= enddate)
{
currentViewAppointments.Add(obj); // you can get the current view appoitments list
}
}
}
For your conveniance, we have prepared the sample and the same can be downloaded from the following link :
Sample-1202204828.zipPlease try this and let us know if you have any queries.
Regards,
Eswari.S