search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Resources backcolor

Asked by Agustin
9 years ago.

Hi guys, I would like to know if I could change the backcolor of my resources. I have a tree with some child resources and i would like to change the backcolor of the childs and their parent.

Thanks and regards!

Answer posted by Kevin Fauver
9 years ago.

If they have UNIQUE subject names, you can change the background color of them in your BeforeEventRender using a case statement based on what is in the subject. Example I have for you, I work with physicians, so I base their background color on the subject (or their name):

protected void DayPilotMonth1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Month.BeforeEventRenderEventArgs e)
string physician = e.Text.ToString();

//RB physicians
switch (physician)
case "Empty":
e.BackgroundColor = "inherit";
e.InnerHTML = string.Format("{0}", " ");
case "Primary":
e.BackgroundColor = "#3F48CC";
e.InnerHTML = string.Format("<img src='../../Images/primary2.png'/>");
case "Secondary":
e.BackgroundColor = "#F97B3B";
e.InnerHTML = string.Format("<img src='../../Images/backup2.png'/>");
case "Physician A":
e.BackgroundColor = "#143E7D";
e.InnerHTML = string.Format("<font color=\"white\">{0}</font>", e.InnerHTML);
case "Physician B":
e.BackgroundColor = "#FA7C7C";

(keep in mind with the new update, InnerHTML can still be used but is obsolete.)

I hope this is what you are looking for

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.