Scheduler for WinForms | ComponentOne
Scheduler Control / Appointments / Availability / Assigning Predefined Availabilities to an Appointment
In This Topic
    Assigning Predefined Availabilities to an Appointment
    In This Topic

    Availabilities can be assigned in code or at run time through the Appointment dialog box. The following code, added the Form_Load event, assign a Tentative availability to an appointment:

    C#
    Copy Code
    c1Schedule1.ViewType = C1.Win.Schedule.ScheduleViewEnum.WorkWeekView;
    // Add a new appointment.  
    C1.C1Schedule.Appointment app;
    app = this.c1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();
    // Set some details for the appointment.   
    app.Subject = "Meeting";
    app.Location = "Large Conference Room";
    app.Duration = TimeSpan.FromMinutes(45);
    app.Start = new DateTime(2021, 11, 01, 13, 30, 0);
    // Assign a predefined label to the appointment.        
    app.Label = this.c1Schedule1.DataStorage.LabelStorage.Labels[6];
    // Assign a predefined availability to the appointment.          
    app.BusyStatus = this.c1Schedule1.DataStorage.StatusStorage.Statuses[C1.C1Schedule.StatusTypeEnum.Tentative];
    

    Note that either the StatusTypeEnum enumeration or the Index can be used to set the availability.

    At run time, the availability can be set in the Appointment dialog box by setting the Show time as drop-down to one of the available options.