schedule appointment

How do I set different font colors and background colors for each appointment?

https://help.syncfusion.com/aspnet-core/schedule/working-with-appointments
You can't see the font color effect on this page.

1 Reply

NR Nevitha Ravi Syncfusion Team January 25, 2018 05:58 PM UTC

Hi Linsee, 

Thank you for contacting Syncfusion Support. 

It is possible to set different font colors and background colors for each appointments using categorize option. Kindly refer the below online sample and UG link to know more about categorizeSettings property. 


        <ej-schedule id="Schedule1" width="100%" height="525px" current-date="new DateTime(2017, 6, 5)"> 
            <e-categorize-settings enable="true" datasource="@ViewBag.categorizeData" allow-multiple="true" id="id" color="color" font-color="fontColor" text="text"></e-categorize-settings> 
            <e-appointment-settings datasource="@ViewBag.appointments" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"' categorize='"Categorize"'></e-appointment-settings> 
        </ej-schedule> 

Controller 
public ActionResult Categorize() 
        { 
            List<Categorize> categorizeValue = new List<Categorize>(); 
            categorizeValue.Add(new Categorize { text = "Blue Category", id = 1, color = "#43b496", fontColor = "#ffffff" }); 
            categorizeValue.Add(new Categorize { text = "Green Category", id = 2, color = "#7f993e", fontColor = "#ffffff" }); 
            categorizeValue.Add(new Categorize { text = "Orange Category", id = 3, color = "#cc8638", fontColor = "#ffffff" }); 
            categorizeValue.Add(new Categorize { text = "Purple Category", id = 4, color = "#ab54a0", fontColor = "#ffffff" }); 
            categorizeValue.Add(new Categorize { text = "Red Category", id = 5, color = "#dd654e", fontColor = "#ffffff" }); 
            categorizeValue.Add(new Categorize { text = "Yellow Category", id = 6, color = "#d0af2b", fontColor = "#ffffff" }); 
 
            ViewBag.categorizeData = categorizeValue; 
            ViewBag.appointments = new ScheduleData().GetAppData(); 
            return View(); 
        } 
 
public class Categorize 
    { 
        public string text { set; get; } 
        public int id { set; get; } 
        public string fontColor { set; get; } 
        public string color { set; get; } 
    } 
</Code> 
 

Kindly check the above links and let us know if you need further assistance. 

Regards, 
Nevitha.

Loader.
Up arrow icon