Thank you for contacting Syncfusion support.
We have prepared the sample to show the recurrence appointment with all its occurrence in Grid which can be download from the below location. Kindly refer the below link and code example used in the sample.
<Code>
if (app.Recurrence == true) // this code block will execute only for recurrence appointment
{
List<DateTime> dates = new List<DateTime>();
int intMax = _context.DefaultSchedule.ToList().Count > 0 ? _context.DefaultSchedule.ToList().Max(p => p.Id) : 1;
DateTime startTime = Convert.ToDateTime(app.StartTime);
DateTime startTime1 = Convert.ToDateTime(app.StartTime);
DateTime endTime = Convert.ToDateTime(app.EndTime);
//Pass the recurrencerule string and the start date of the appointment to this method that will return the dates collection based on the recurrence rule
dates = RecurrenceHelper.GetRecurrenceDateTimeCollection(app.RecurrenceRule, Convert.ToDateTime(app.StartTime)).ToList();
// Now, the variable “dates” contains the date collection, with which the appointment instances are needed to be created manually.
var diff = endTime - startTime1;
for (var i = 0; i < dates.Count; i++) // this loop is used to create the appointment instances for the generated dates
{
startTime = Convert.ToDateTime(dates[i].AddHours(startTime1.Hour).AddMinutes(startTime1.Minute)); //start time for each occurrences will be calculated
endTime = Convert.ToDateTime(startTime.AddHours(diff.Hours).AddMinutes(diff.Minutes)); //end time for each occurrences will be calculated
DefaultSchedule appoint = new DefaultSchedule()// Appointment object creation
{
Id = intMax + i,
StartTime = startTime,
EndTime = endTime,
Subject = app.Subject,
Recurrence = app.Recurrence,
AllDay = app.AllDay,
RecurrenceRule = app.RecurrenceRule,
};
newApp.Add(appoint);
}
return newApp;
}
</Code>
Regards,
Karthigeyan