New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

NavigationCommand

The NavigationCommand occurs when the user clicks on a control that changes the selected day, view, or mode of the scheduler.

NavigationCommand has two parameters:

  • sender is the scheduler control.

  • e is an object of type SchedulerNavigationCommandEventArgs. It has three properties:

  • Command indicates what control the user clicked. Possible values are listed in the table below.

  • SelectedDay is a DateTime specifying the target date when Command is SchedulerNavigationCommand.SwitchToSelectedDay.

  • Cancel is a boolean value that lets you prevent the scheduler from responding to the navigation command.

The Command property is of type SchedulerNavigationCommand. This type has the following possible values:

 

NameDescription
DisplayNextAppointmentSegmentThe user clicked the right-pointing arrow in an appointment to move to the next day.
DisplayPreviousAppointmentSegmentThe user clicked the left-pointing arrow in an appointment to move to the previous day.
NavigateToNextPeriodThe user clicked the right-pointing arrow in the navigation pane.
NavigateToPreviousPeriodThe user clicked the left-pointing arrow in the navigation pane.
SwitchFullTimeThe user clicked the link button in the footer to switch from full-day mode to business hours (or vice versa).
SwitchToDayViewThe user clicked the Day button of the view tabs when the scheduler was not already in Day view.
SwitchToWeekViewThe user clicked the Week button of the view tabs when the scheduler was not already in Week view.
SwitchToMonthViewThe user clicked the Month button of the view tabs when the scheduler was not already in Month view.
SwitchToSelectedDayThe user clicked the today button in the navigation pane or the "show more" link in a cell in Month view. The SelectedDay parameter is the day to which the scheduler will be switched.
SwitchToMultiDayViewThe user clicked the Multi-Day button of the view tabs when the scheduler was not already in Multi-day view.
NavigateToSelectedDateUsed when the integrated date picker is the source of the NavigationCommand event.

Example

This example disables the "today" button, while still allowing a switch to Day view from a cell in Month view.

C#
	
protected void RadScheduler1_NavigationCommand(object sender, SchedulerNavigationCommandEventArgs e)
{
	if (e.Command == SchedulerNavigationCommand.SwitchToSelectedDay && RadScheduler1.SelectedView == SchedulerViewType.DayView) 
		e.Cancel = true;
}
	

See Also

In this article
ExampleSee Also
Not finding the help you need?
Contact Support