How to: Hide the Reminder (Bell) Icon for Outdated Appointments in a Series

  • 2 minutes to read

The following example demonstrates how to hide the reminder icon for past appointments in a series. Since they are outdated, the user should not be reminded of them, and displaying the bell icon has no sense.

To achieve this, the SchedulerControl.AppointmentViewInfoCustomizing event is handled. The RecurringReminder.AlertOccurrenceIndex property is used to indicate the first appointment in a chain for which an alert will be invoked. All occurrences with Appointment.RecurrenceIndex less than the AlertOccurrenceIndex are outdated.

void scheduler_AppointmentViewInfoCustomizing(object sender, 
    AppointmentViewInfoCustomizingEventArgs e)
{
    Appointment apt = e.ViewInfo.Appointment;
    if (apt.HasReminder && apt.Type == AppointmentType.Occurrence && 
        apt.RecurrencePattern != null)
    {
        Appointment pattern = apt.RecurrencePattern;
        RecurringReminder reminder = (RecurringReminder)pattern.Reminder;
        e.ViewInfo.ShowBell = reminder.AlertOccurrenceIndex < = apt.RecurrenceIndex;
    }
}
See Also