scheduler-scrollbar-position.png

ASP.NET WebForms

The Scheduler scrollbar position can be read and changed using the following properties:

  • ScrollX
  • ScrollY

Both properties work with the scrollbar position in pixels. The scrollbar position can be set during initial page load, during PostBacks and CallBacks. Changing the scrollbar position during CallBack causes a full update (Update() call is required).

In addition, it's possible to set the horizontal (X) scrollbar position using the following method:

  • SetScrollX(DateTime)

SetScrollX calculates the scrollbar position from a given time point (position parameter). It works only during the initial page load and during PostBacks.

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
  {
      DayPilotScheduler1.SetScrollX(DateTime.Today.AddDays(-1));
      setDataSourceAndBind();
      DayPilotScheduler1.UpdateWithMessage("Welcome!");
  }
}

ASP.NET MVC

Set/get properties (pixels):

  • ScrollX
  • ScrollY

Set method (DateTime):

  • ScrollTo(DateTime)

Example

protected override void OnInit(InitArgs ea)
{
  ScrollTo(DateTime.Today);
  UpdateWithMessage("Welcome!", CallBackUpdateType.Full);
}

JavaScript

The following methods are available:

Examples

Scroll one month forward.

dps.scrollTo(dps.getDate(dps.getScrollX()).addMonths(1));

Scroll one month backward.

dps.scrollTo(dps.getDate(dps.getScrollX()).addMonths(-1));