Can event title has one or more color to show

2 posts, 0 answers
  1. 宏吉
    宏吉 avatar
    40 posts
    Member since:
    Mar 2017

    Posted 14 Feb 2019 Link to this post

    Events maybe have some different types , I want if it has type 1 give it title one circle color , has type 2 give other color..... and so on

    So maybe one event has multiple colors, how to do this?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5453 posts

    Posted 18 Feb 2019 Link to this post

    Hello,

    Perhaps the easiest option is to get the event HTML element when it is dataBound and to add a class to it, or otherwise change its appearance as needed. Here's an example of doing that: https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/appearance/modify-event-styling-on-databound (you don't have to use a custom template to do this).

    Alternatively, you can define your own template for the appointments and use their data to define colors and/or CSS classes entirely in the template without using the .dataBound event: https://demos.telerik.com/kendo-ui/scheduler/templates.
    Here are some more examples of similar changes: https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/appearance/set-event-color-in-the-template and https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/appearance/event-custom-background-color.

    In case changing the background color is sufficient, you can do that through resources that you can associate events with: https://demos.telerik.com/kendo-ui/scheduler/resources.


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top