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

How to show a special date between start and end date in Gantt

Asked by Roger
9 years ago.

After loading Task in Gantt i need to show no the complete range auf time of all tasks, so I set StartDate and Days. But I don't want the diagramm to show the start of that time range, instead I have to directly show a special date (for example the actual day). Otherwise I always have to scroll to that date. Same have to be done after selecting a row with postback.
So my question: How to set the startdate that is shown in the diagram?

Example: Tasks starting at 01/01/2015, Ends at 12/31/2015, and gantt should be scrolled to 06/01/2015 at start of showing.

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

Since build 8.1.3445 you can use ScrollTo() on the server side.

protected void Page_Load(object sender, EventArgs e)
{
  // ...
  if (!IsPostBack)
  {
      DayPilotGantt1.StartDate = DateTime.Today.AddDays(-10);
      DayPilotGantt1.Days = 30;
      DayPilotGantt1.ScrollTo(DateTime.Today);
  }
}

You can download the latest build in the sandbox:
http://www.daypilot.org/sandbox/

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