Date Navigations

## 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.

//disabling navigation gesture
           schedule.EnableNavigation = false;

Programmatically change to specific dates

Visible dates can be moved to specific date using MoveToDate property 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

Calendar moveToSpecificDate = Calendar.Instance;
            moveToSpecificDate.Set(2017, 7, 25);
            schedule.MoveToDate = moveToSpecificDate;

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.

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.

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

NOTE It can be navigated until it reaches the Min Max dates.

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.

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

NOTE It can be navigated until it reaches the Min Max dates.

Range for visible dates

Visible dates can be restricted between certain range of dates, using MinDisplayDate and MaxDisplayDate property in SfSchedule. It is applicable in all the schedule views.

Minimum Display Date

MinDisplayDate will restrict date navigations features of Backward, MoveToDate and also can’t swipe the control using touch gesture beyond the min max date range. Thus, Inline and selection feature in month view will works only within the min max date range.

Calendar currentDate = Calendar.Instance;
            Calendar minDate = (Calendar)currentDate.Clone();
            minDate.Set(2015, 5, 12);
            schedule.MinDisplayDate = minDate;

Maximum Display Date

MaxDisplayDate will restrict date navigations features of Forward, MoveToDate and also can’t swipe the control using touch gesture beyond the max date range. Thus, Inline and selection in month view will works only within the max date range.

Calendar currentDate = Calendar.Instance; 
            Calendar maxDate = (Calendar)currentDate.Clone();
            maxDate.Set(2025, 11, 12);
            schedule.MaxDisplayDate = maxDate;