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

More than 1 color in an event

Asked by Maxime
15 years ago.
Hi,

I would like to know if it's possible to have more than 1 background (or text) color in an event box ?

For example

(1 event)

/-------------------------------------/
/----------Text in red-------------/
/-------------------------------------/
/----------Text in blue-----------/
/------------------------------------/

or

(1 event)
/------------------------------------/--------------------------------------/
/-----Background green------/------Background grey--------/
/------------------------------------/-------------------------------------/

I guess a solution would be to change the innerHTML of the div but do you have any code snippets for that ?
Could there be a workaround with css files ?
Any other ideas ?

Thanks,

Maxime
Comment posted by Maxime
15 years ago.
I tried something simple, it works:

protecte void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.BeforeEventRenderEventArgs e)
{
e.innerHTML= "<div><div style=\"background-color:Silver>Text Silver</div><div style=\"background-color:Blue>Text Blue</div></div>";
}
Comment posted by Dan Letecky
15 years ago.
Yes, that's the best solution. Thanks for posting it.

BeforeEventRender + e.InnerHTML is the most powerful way to change the events (add icons, background images, links, etc.). The only limitation is the hardcoded padding (about 2px) but you can change it easily in the source code.
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.