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

Scheduler Event Phases

Asked by Corey
4 years ago.

Hello All -

I was trying to find documentation for ASP webform C# implementation of Scheduler with Event Phases. ALso curious if each phase could show progress or not on it...

Any help would be much appreciated

Comment posted by Corey
4 years ago.

Also am looking how I would do this iterating through SQL

Answer posted by Dan Letecky [DayPilot]
4 years ago.

The event phases are displayed using active areas (https://doc.daypilot.org/scheduler/event-active-areas/). Active areas are rectangles inserted into events. The can be positioned using css-like left/right/width properties or using start and end (DateTime values).

The phases can be displayed by adding active areas in BeforeEventRender event handler with the position specified using Start() and End():

protected void DayPilotScheduler1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
  e.Areas.Add(new Area().Start(e.Start).End(e.Start.AddHours(2)).Top(0).Bottom(0).BackgroundColor("green");
}

If you want to load the phase data from SQL it's best to include it in the event object (DataSource) and reach it using e.DataItem in BeforeEventRender.

See also:
https://doc.daypilot.org/scheduler/event-customization/

There is no built-in support for a progress bar but you can add it using yet another active area with custom HTML. This would be a full-width progress bar:

protected void DayPilotScheduler1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
  int progress = 50;
  e.Areas.Add(new Area().Left(0).Right(0).Bottom(0).Height(5).Html("<div style='position:absolute;left:0;top:0;bottom:0;width:" + progress + "%;background-color:red;'></div>";
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.