Date Navigations in UWP Scheduler (SfSchedule)

10 May 20213 minutes to read

Enabling Navigation

By default, Schedule views can be moved backwards and forwards using touch swipe gesture. This navigation gesture can be enabled or disabled by setting EnableNavigation property of SfSchedule. By default, it is enabled.

<schedule:SfSchedule EnableNavigation="False"/>
//disabling navigation gesture
           schedule.EnableNavigation = false;

Programmatically change to specific dates

Visible dates can be moved to specific date using MoveToDate method available in SfSchedule. It will move to any specific date if the schedule view is Day View, similarly it will move to the specific week if it is week view and to specific month if it is month view

Note: The specified date should lies between MinDisplayDate and MaxDisplayDate, if the specified date is greater than MaxDisplayDate then the view moved to MaxDisplayDate similarly if the specified date is lesser than the MinDisplayDate then the view moved to MinDisplayDate.

  • C#
  • schedule.MoveToDate(new DateTime(2018, 1, 1));

    Programmatically change to specific time.

    You can move the SfSchedule to particular time by passing the Timespan value to MoveToTime method. This method is applicable for Day, week and TimeLine view of SfSchedule control.

    Note: Since this method handles the position of scroll, it calls only after SfSchedule view gets loaded and MoveToTime is only applicable in day view of Windows Phone.

  • C#
  • schedule.MoveToTime(new TimeSpan(8, 0, 0));

    Programmatically change to adjacent dates.

    By default the date can be navigated to next and previous view using touch gesture, by swiping the control in right to left and right to left direction. The view can be also changed programmatically using Forward and Backward method available in SfSchedule.

    • Forward
    • Backward

    Forward

    You can use the Forward method for viewing the next immediate visible dates in the SfSchedule. It will move to next month if the schedule view is month, similarly it will move to next week for week view and next day for day view.

  • C#
  • //Viewing next immediate visible dates
                schedule.Forward();

    Note: - Date can be navigated until it reaches the Min Max date.

    Backward

    You can use the Backward method for viewing the previous immediate visible dates in the SfSchedule. It will move to previous month if the schedule view is month, similarly it will move to previous week for week view and previous day for day view.

  • C#
  • //Viewing previous immediate visible dates
                schedule.Backward();

    Note: - Date can be navigated until it reaches the Min Max date.

    Range for visible dates

    Visible dates can be restricted between certain range of dates using MinimumDisplayDate and MaximumDisplayDate properties available in SfSchedule control. It is applicable in all the schedule views.
    So that beyond the min max date range, it will restrict date navigations features of Forward, backward, MoveToDate and also can’t swipe the control using touch gesture beyond the min max date range.

  • C#
  • schedule.MinimumDisplayDate = (new DateTime(2015, 9, 16));
                schedule.MaximumDisplayDate = (new DateTime(2025, 11, 27));