The Appointment dialog box used in C1Scheduler for LightSwitch allows users to set a subject, location, label, start and end time, reminder, availability status, and whether the appointment is an all day event and recurring over a specified period of time. You can also specify any resources, categories, and contacts here. The scheduler provides twelve predefined labels and four predefined statuses for scheduler. This blog discusses approach to use the User Defined Label and Status in the Scheduler instead of predefined ones. This can be done in two :
You can add User defined Labels and Statuses in the Created() method of Calendar screen using the following code :
partial void Calendar_Created()
{
// Write your code here.
IContentItemProxy _proxy = this.FindControl("C1Scheduler");
_proxy.ControlAvailable += (s, ea) =>
{
C1Scheduler scheduler = ea.Control as C1Scheduler;
//Adding a custom label
C1.C1Schedule.Label label = new C1.C1Schedule.Label();
label.Text = "Purple";
label.Color = System.Windows.Media.Colors.Purple;
scheduler.DataStorage.LabelStorage.Labels.Add(label);
//Adding a custom status
C1.C1Schedule.Status status = new C1.C1Schedule.Status();
status.Text = "Very Busy";
status.Color = System.Windows.Media.Colors.Red;
scheduler.DataStorage.StatusStorage.Statuses.Add(status);
};
}
The LabelCollection and StatusCollection can be bound to a datatable. For binding, follow the steps below :
Now, if you run the application and create an appointment, you should see the new labels and status in the drop downs.