Different duration bar color for different resources
Asked by Agustin 18 years ago.
Hello,
I need to show all the information or all the events related with different resources at the same time using the daypilot calendar control, so, in order to identify which events belong to an specific resource i need to assign a color per resource, which arises the next questions:
1. Is it possible to do this ?
2. How can I change the color of the event per resource?
Place the resource in the DataTagFields
and in the BeforeEventRender you can switch the e.Tag[0] en set the e.BackgroundColor to a desired color foreach resource
Comment posted by Lauwens 18 years ago.
Perhaps I wasn't that clear, and i see you wanted to change the DurationBar not the whole background color
So here code example
protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
switch (e.Tag)
{
case 0:
e.DurationBarColor = "yellow";
break;
case 1:
e.DurationBarColor = "red";
break;
case 2:
e.DurationBarColor = "green";
break;
}
}
Comment posted by Agustin 18 years ago.
Thanks
Comment posted by Dan Letecky 18 years ago.
Lauwens, Thanks for posting the answer!
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.