Home Unanswered Active Tags New Question

More than 1 color in an event

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
Asked by Maxime 3 years ago.
Replies
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 Maxime 3 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.
Comment posted by Dan Letecky 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java