Hi Mohit,
Thanks for using Syncfusion product.
To find the conflicting appointment, we can use the GetSchedule method, to get the list of appointment in that specified date and use the ItemChanging event to handle an appointment. Please refer to the code example and a sample,
Code example
this.scheduleControl1.ItemChanging += scheduleControl1_ItemChanging;
void scheduleControl1_ItemChanging(object sender,ScheduleAppointmentCancelEventArgs e)
{
if (e.Action == ItemAction.Add)
{
bool isConflict = false;
SimpleScheduleDataProvider provider = this.scheduleControl1.DataSource asSimpleScheduleDataProvider;
IScheduleAppointmentList list = provider.GetSchedule(e.ProposedItem.StartTime, e.ProposedItem.EndTime);
if (list is ScheduleAppointmentList)
{
ScheduleAppointmentList applist = list as ScheduleAppointmentList;
foreach (IScheduleAppointment item in applist)
{
if (item.StartTime <= e.ProposedItem.EndTime && e.ProposedItem.StartTime <= item.EndTime)
{
isConflict = true;
}
}
if (isConflict)
{
//Handle the appointments.
e.Cancel = true;
}
}
}
} |
Regards,
Mohanraj G