Home Unanswered Active Tags New Question

How to set the background color dynamic

Hi,

I've the problem that the background color is set in the codebehinnd, but isn't changed in the view.
What's wrong with my implementation?

The backgroundcolor is "#FFB612" and it will be changed to "#CCDC00". But I still see the "#FFB612" color in my browser.

See code:

public void _dayPilotScheduler_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
e.ToolTip = "Move over for more information";
e.EventClickEnabled = true;
// get column
var foundSchedule =
Schedules.Find(
schedule => (schedule.UniqueID.ToString() == e.Value));

if (foundSchedule != null)
{
switch (foundSchedule.ScheduleApplicationStatus)
{
case eScheduleApplicationStatus.BroadcastInFuture:
e.BackgroundColor = "#FFB612";
break;
case eScheduleApplicationStatus.Inactive:
e.BackgroundColor = "#FFB612";
break;
case eScheduleApplicationStatus.Error:
e.BackgroundColor = "#D0103A";
break;
case eScheduleApplicationStatus.BroadcastingNow:
e.BackgroundColor = "#CCDC00";
e.DurationBarColor = "#CCDC00";
break;
}

e.DurationBarColor = "#FFFFFF";

e.InnerHTML = string.Format("{0} - {1} - {2}", foundSchedule.ApplicationID,
foundSchedule.ApplicationTitle, foundSchedule.TargetName);

}

e.EventRightClickEnabled = false;
}

Kind regards,

Rob

Asked by Rob Janssen 2 years ago.
Replies

Issue is solved. The scheduler was a part of an update panel. When the update panel is updated. The colors in the scheduler are also updated.

Rob

Comment posted by Rob Janssen 2 years ago.

Thanks for posting the solution, Rob.

Comment posted by Dan Letecky 2 years ago.
New Reply
This reply is
Your name (optional):

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