Edit this page

Commands

RadScheduleView exposes its functionality through various commands that can be executed on its behalf. All commands are placed in the static class RadScheduleViewCommands. The purpose of this tutorial is to show you all of the commands exposed by the RadScheduleViewCommands class and how to execute them.

CreateAppointment / CreateAppointmentWithDialog Commands

When you want to create a new appointment and show the EditAppointmentDialog, then you need to use the CreateAppointment or CreateAppointmentWithDialog commands. If no parameter is passed, the SelectedSlot of RadScheduleView will be used for the new appointment start and end dates. If you want to explicitly specify which will be the start and end date you should pass a parameter of type IDateSpan (for example Slot is an IDateSpan).

The difference between both commands is when neither the parameter nor the SelectedSlot is set. In this case only the CreateAppointmentWithDialog command will show EditAppointmentDialog for the first visible slot, while CreateAppointment command won’t be executed.

RadScheduleViewCommands.CreateAppointment.Execute(null, ScheduleView);
RadScheduleViewCommands.CreateAppointmentWithDialog.Execute(null, ScheduleView);

CreateInlineAppointment Command

Use it when you want to create a new appointment via the inline editing. If no parameter is passed, the SelectedSlot of RadScheduleView will be used for the new appointment start and end dates. If you want to explicitly specify which will be the start and end date you should pass a parameter of type IDateSpan (for example Slot is an IDateSpan):

RadScheduleViewCommands.CreateInlineAppointment.Execute(null, ScheduleView);

IsInlineEditingEnabled property of the RadScheduleView should be set in order to use the command.

EditAppointment Command

Use it when you want to show the edit dialog for an appointment. If no parameters are passed it uses the SelectedAppointment of RadScheduleView. By default this command is bound to double click on appointment.

RadScheduleViewCommands.EditAppointment.Execute(null, ScheduleView);

DeleteAppointment Command

When you want to remove an appointment from AppointmentsSource collection, then you need to use the DeleteAppointment command. If no parameter is passed the SelectedAppointment will be used.

RadScheduleViewCommands.DeleteAppointment.Execute(null, ScheduleView);

EditRecurrenceRule Command

When you want to open EditRecurrenceDialog, then you need to use the EditRecurrenceRule command. This command is used mainly in EditAppointmentDialog.

DeleteRecurrenceRule Command

When you want to remove the recurrence, then you need to use DeleteRecurrenceRule Command. The command is used mainly in EditRecurrenceDialo

EditParentAppointment Command

If you want to edit the master appointment, when the user has initiated editing of an occurrence or exception from appointment's RecurrenceRule, you need to use the EditParentAppointment command. This command is used mainly in EditAppointmentDialog.

SetDayViewMode Command

Executing this command will result in setting the RadScheduleView’s ActiveViewDefinition property to DayViewDefinition.

RadScheduleViewCommands.SetDayViewMode.Execute(null, ScheduleView);

SetWeekViewMode Command

Executing this command will result in setting the RadScheduleView's ActiveViewDefinition property to WeekViewDefinition.

RadScheduleViewCommands.SetWeekViewMode.Execute(null, ScheduleView);

SetMonthViewMode Command

Executing this command will result in setting the RadScheduleView's ActiveViewDefinition property to MonthViewDefinition.

RadScheduleViewCommands.SetMonthViewMode.Execute(null, ScheduleView);

SetTimelineViewMode Command

Executing this command will result in setting the RadScheduleView's ActiveViewDefinition property to TimelineViewDefinition.

RadScheduleViewCommands.SetTimelineViewMode.Execute(null, ScheduleView);

IncreaseVisibleDateLarge / DecreaseVisibleDateLarge Commands

Increases/decreases the first visible date with n months or days, where n is the value of the LargeChangeInterval property of the ActiveViewDefinition. Executing this command is equivalent to changing the displayed days using the navigation buttons.

RadScheduleViewCommands.IncreaseVisibleDateLarge.Execute(null, ScheduleView);
RadScheduleViewCommands.DecreaseVisibleDateLarge.Execute(null, ScheduleView);

SetAppointmentImportance Command

When you want to set the Appointment's Importance property, then you need to execute the SetAppointmentImportance command. This command is used primely in EditAppointmentDialog.

GoToPreviousAppointment / GoToNextAppointment Commands

Use these commands when you want to navigate to the previous/next appointment outside the visible range:

RadScheduleViewCommands.GoToPreviousAppointment.Execute(null, ScheduleView);
RadScheduleViewCommands.GoToNextAppointment.Execute(null, ScheduleView);