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

How to set the background color dynamic

Asked by Rob Janssen
14 years ago.

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

Comment posted by Rob Janssen
14 years ago.

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 Dan Letecky
14 years ago.

Thanks for posting the solution, Rob.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.