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

Resources backcolor

Asked by Agustin
11 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
11 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}", " ");
break;
case "Primary":
e.BackgroundColor = "#3F48CC";
e.InnerHTML = string.Format("<img src='../../Images/primary2.png'/>");
break;
case "Secondary":
e.BackgroundColor = "#F97B3B";
e.InnerHTML = string.Format("<img src='../../Images/backup2.png'/>");
break;
case "Physician A":
e.BackgroundColor = "#143E7D";
e.InnerHTML = string.Format("<font color=\"white\">{0}</font>", e.InnerHTML);
break;
case "Physician B":
e.BackgroundColor = "#FA7C7C";
break;
....
}

(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.