JavaScript
Add backColor property to DayPilot.Event.data:
<div id="dp"></div> <script type="text/javascript"> var dp = new DayPilot.Scheduler("dp"); dp.events.list = [ { start: "2013-03-25T00:00:00", end: "2013-03-25T12:00:00", id: "123", resource: "A", text: "Event", backColor: "#cccccc" } ] // ... dp.init(); </script>
ASP.NET WebForms
protected void DayPilotScheduler1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e) { // this assumes your event object in Events collection has "color" field or property e.BackgroundColor = (string) e.DataItem["color"]; }
ASP.NET MVC
Add OnBeforeEventRender method to the Dps class derived from DayPilotScheduler:
protected override void OnBeforeEventRender(BeforeEventRenderArgs e) { // this assumes your event object in Events collection has "color" field or property e.BackgroundColor = (string) e.DataItem["color"]; }