Edit appointment theme on BeforeAppointmentFormat?

Posted by: spaceage15 on 9 March 2018, 11:18 am EST

    • Post Options:
    • Link

    Posted 9 March 2018, 11:18 am EST

    Is there a way to apply a single theme to different appointments? I am wanting apply a theme style to one appointment but I don’t want other appointments to have that theme.

  • Posted 11 March 2018, 3:34 pm EST

    Hello Edson!

    I would like you to know that any specific theme can be applied on the control (C1Schedule) only, and not on the individual appointment.

    But yes, in BeforeAppointmentFormat event of C1Schedule, you can change background of any desired appointment using e.BackColor and e.BackColor2. Also, you can fetch the current appointment and customize this as per your requirements.

    private void C1Schedule1_BeforeAppointmentFormat(object sender, BeforeAppointmentFormatEventArgs e)
    {
           //Condition here
           if(e.Appointment.Subject == "Appt 2")
           {
                    e.BackColor = Color.White;
                    e.BackColor2 = Color.SandyBrown;
            }
    }
    

    Best regards,

    Meenakshi

  • Posted 12 March 2018, 2:39 pm EST

    Hi Meenakshi,

    What Im trying to do it is apply styling to individual appointments but I’m having problems with the way the icons and text are being aligned. No matter what html tags I use to properly aligned(see the first jpg), it has no response to the scheduler appointments. In c1ThemeDesigner app, I’m able to apply alignment to text and icons (see second jpg). And even if you bunch a few appointments in the same time-slot the icon remains in the position it needs to be but that doesn’t happen in my application(see second jpg).

    How would you handle this?

    Currently, I’m add different icons as need be using the BEFOREAPPOINTMENTFORMAT event to apply formatting using html tags in text property like so

    If e.Appointment.BusyStatus IsNot Nothing Then
                If e.Appointment.BusyStatus.Text IsNot "" Then
                    If e.Appointment.BusyStatus.Equals(C1Schedule1.DataStorage.StatusStorage.Statuses(0)) Then 'Arrived
                        statusIcon = "<td><img src='res://arrived.gif/' height='16' width='16' alt='icon' align='top' /></td>"
                    End If
                    If e.Appointment.BusyStatus.Equals(C1Schedule1.DataStorage.StatusStorage.Statuses(1)) Then 'Completed
                        statusIcon = "<td><img src='res://completed.gif/' height='16' width='16' alt='icon' align='' /></td>"
                    End If
                    If e.Appointment.BusyStatus.Equals(C1Schedule1.DataStorage.StatusStorage.Statuses(2)) Then  'Cancelled'
                        statusIcon = "<td><img src='res://cancelled.gif/' height='16' width='16' alt='icon' align='top' /></td>"
                    End If
                End If
            End If
    e.Text = "<table cellspacing='0'><tr>" + statusIcon + servicePaidIcon + commentsIcon +"<td>" + e.Appointment.Subject + " (" + e.Appointment.Label.ToString + ")</td></tr></table>"
    ```[img]public\uploads\0eedafc25a50b4c6b42364280203c04e1520909481588.jpeg[/img][img]public\uploads\1555bbab071c09d314257fe048e162d01520909506672.jpeg[/img]
  • Posted 14 March 2018, 8:38 pm EST

    Hello!

    Thanks for the details.

    Since this icon image is being inserted in text using HTML tags, and not being displayed as individual icon. Its alignment does not remain same as the one in your custom theme.

    We are working on this to see if there is any appropriate way to achieve the required behaviour. We will come back to you soon.

    Best regards,

    Meenakshi

  • Posted 15 March 2018, 4:48 pm EST

    Can you please give us sample application with your custom theme, so that the team can check your exact use case?

    Thanks,

    Meenakshi

  • Posted 16 March 2018, 2:16 pm EST

    Hi Meenakshi,

    I just want to be clear that I’m not using a custom theme. I only mention the theme designer because its as if the problem that I’m having with the icon not being aligned does not exist in the theme designer when I test it there.

    Can you give any suggestions on how to align an icon image and text within the appointment format? That’s really my issue at the moment. The theme designer is able to align perfectly every time.

    Below I attached a sample project with the way that I’m using the HTLM tags. Create a few appointments in the same time slot (as I did in the images above) and you will see the icon and text lose its positioning in the appointment bubble.

    Thanks in advance

    Edson

    MultiUser.zip

  • Posted 19 March 2018, 3:32 pm EST

    Hi Edson!

    This is in discussion with the team, and will update you if there is any appropriate way to achieve this behaviour.

    Best regards,

    Meenakshi

  • Posted 23 March 2018, 10:29 am EST

    Hello Meenakshi,

    Thanks you for the help and I look forward to hearing back from the team.

    Is there an estimated time when we’ll hear back from the team? Or if, they have any suggestions to handle this issue?

    This particular enhancement has been past due (on my end) because of this issue, so any insight would be appreciated.

    Regards,

    Edson

  • Posted 25 March 2018, 2:03 pm EST

    Hi Edson!

    As per the team, you can try to use one of the next variants to set image into top-left corner :

    e.Text = "<table cellspacing='0'><tr><td><img src='res://arrived.gif/' height='16' width='16' alt='icon' />" + subject + " (" + label + ")</td></tr></table>"
    
    statusIcon = "<td ><img src='res://arrived.gif/' height='16' width='16' alt='icon' /></td>"
    
    e.Text = "<table cellspacing='0'><tr style='vertical-align:top' > " + statusIcon + " < td > " + subject + "(" + label + ")</td></tr></table>"
    
    statusIcon = "<td style='vertical-align:top'><img src='res://arrived.gif/' height='16' width='16' alt='icon' /></td>"
    
    e.Text = "<table cellspacing='0'><tr > " + statusIcon + " < td > " + subject + "(" + label + ")</td></tr></table>"
    

    Hope this helps you.

    Best regards,

    Meenakshi

  • Posted 27 March 2018, 7:11 am EST

    Thanks Meenakshi and Team. That worked for me.

    I did have one more related question. If I had more than just one icon and text (within the table rows and columns), can I apply different styling to them like how you guys just showed me for the Icon?

  • Posted 27 March 2018, 6:16 pm EST

    Yes Edson! You can use the same approach. The code, then, should look like this :

    statusIcon1 = "<td style='vertical-align:bottom'><img src='res://arrived.gif/' height='16' width='16' alt='icon'/></td>"
    statusIcon2 = "<td style='vertical-align:top'><img src='res://completed.gif/' height='16' width='16' alt='icon'/></td>"
    
    e.Text = "<table cellspacing='0'><tr >" + statusIcon1 + "<td>" + subject + " (" + label + ")</td></tr><tr>" + statusIcon2 + "<td>" + *SomeTextHere* + "</td></tr></table>"
    

    Best regards,

    Meenakshi

  • Posted 30 March 2018, 8:20 am EST

    Thank you very much Meenakshi!

    -Edson

Need extra support?

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

Learn More

Forum Channels