Adding/Customizing Appointment with Scheduler control in C#
KetticScheduler control supports the creating and editing of appointments, like setting of the status for a particular appointment and selection of a color coded category. In addition, the user interface designers of the appointment are able to tweak, customize and extend the Scheduler dialogs with other new controls. There are a few properties available to the designers to customize the Scheduler to fit custom scenario. The appointments can be any events and an intuitive Edit Appointment dialog is available to create, edit, or delete appointments.
C# Create a new Appointment for Scheduler
To create an appointment in KetticScheduler, we shall use one of the overloads to create a new Appointment instance. The C# code sample below shows how to add a new appointment and apply the appointment properties, StatusId and BackgroundId, to present a visual feedback.
Appointment appointment = new Appointment(DateTime.Now, TimeSpan.FromMinutes(15), "Summary", "Description");
appointment.StatusId = 3;
appointment.BackgroundId = 5;
C# Customize Appointments for Scheduler
KetticScheduler control provides a large flexibility of customization of the appointment. There are a variety of collections and properties available for the developers to customize the appointments in C# Windows Forms application.
- Statuses collection, this collection is able to add new a Status to an appointment and the valid statuses include 1 Free, 2 Busy, 3 Unavailable, and 4 Tentative. In addition, there is an AppointmentStatusInfo C# class allows the users to extend and replace the Statuses collection. The C# code below shows how to apply this class.
this.ketticScheduler1.Statuses.Add(new AppointmentStatusInfo(6, "test", Color.Green, Color.Green, AppointmentStatusFillType.Solid));
- Backgrounds collection, this collection is used to customize the Background to an appointment and the valid statuses include 1 None, 2 Important, 3 Business, 4 Personal, 5 Vacation, 6 MustAttend, 7 TravelRequired, 8 NeedsPreparation, 9 Birthday, 10 Anniversary, and 11 PhoneCall. The AppointmentBackgroundInfo C# class will extend and replace the Backgrounds collection. The C# code below shows how to apply this class
this.ketticScheduler1.Backgrounds.Add(new AppointmentBackgroundInfo(15, "test", Color.Green));
- StatusId, this property of the Appointment is able to change the status via selecting a value from a predefined values list.
- Summary, Description and Location, these properties of appointment C# class are able to customize the strings of the Summary, Description or Locations of an appointment.
- Start, End, Duration, these properties of appointment C# class are used to change the Start, End, Duration of the appointment
- ApplyEdit and ApplyDelete, these two properties are able to enable and disable the editing and deleting operations of an appointment.
- BackgroundId, this property of the Appointment is able to change the background via selecting a value from a value list
- Visible, this property is used to hide and display an appointment
- AppointmentTitleFormat, this property is able to change the text formatting of an appointment
- ToolTipText, this property is used to set the tool tip text of an appointment