Posted 27 June 2021, 11:38 am EST
I would like to know if I can change the back color of one day on the month view calendar based on some logic. For example:
Get appointments from a data source
Loop through the appointments and determine if they meet certain criteria
if (all appointments meet the certain criteria for a specific date)
–make date background green - but only for that date.
Is this possible? I think my syntax is wrong.
Here is my current code inside of looping through records from the database. The variable “app” is scoped in the loop so it is new every iteration.:
//make a new appointment
C1.C1Schedule.Appointment app = this.c1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();
app.AllDayEvent = true;
// Set some details for the appointment.
app.Subject = eventText;
if (some boolean condition has been met)
{
app.Label.Color = Color.FromArgb(99, 60, 179, 113);
}
else
{
app.Label.Color = Color.FromArgb(255, 255, 255, 255);
}
//this code does not work - it sets ALL of the appointments to be same color.
//I’ve stepped through it to be sure the boolean logic works