C1 Schedule Control

Posted by: kim.neville on 27 June 2021, 11:38 am EST

  • 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

  • Posted 28 June 2021, 3:55 am EST

    Hi Kim,

    you are very near to the solution: you just have to create a new label for the appointments with a different color.

    Hope this helps

    Wolfgang

  • Posted 28 June 2021, 7:58 am EST

    Hello,

    Your case has been replied on your support ticket CAS-23221-P2M5S6.

    Please continue the conversation there only to avoid confusion.

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels