New to Telerik UI for WinFormsStart a free 30-day trial

Performs selection operations and provides information about the current selection of cells and appointments in RadScheduler. The cell selection in RadScheduler represents a single date interval - it has SelectionStartDate and SelectionEndDate. A few other parameters help to fully identify the current selection - IsAllDayAreaSelection, SelectedResourceId, CurrentCell. There are two modes for appointment selection - single selection and multi selection. Use the AllowAppointmentsMultiSelect property of RadScheduler to switch between them.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class SchedulerSelectionBehavior

Inheritance: objectSchedulerSelectionBehavior

Constructors

Creates a the selection behavior for the specified RadScheduler.

C#
public SchedulerSelectionBehavior(RadScheduler scheduler)
Parameters:schedulerRadScheduler

The scheduler this behavior belongs to.

Fields

C#
protected List<IEvent> selectedAppointmentsList

Properties

Gets or sets the coordinates of the current cell. The current cell is the start cell that will be used when performing navigation with the arrow keys.

C#
public TableLayoutPanelCellPosition CurrentCell { get; set; }

Gets the SchedulerCellElement which stands on the coordinates provided by the CurrentCell property.

C#
public SchedulerCellElement CurrentCellElement { get; }

Gets a value indicating whether there is any appointment selected.

C#
public virtual bool HasAppointmentsSelected { get; }

Gets a value indicating whether there is any cell selected.

C#
public virtual bool HasCellsSelected { get; }

Gets a value indicating whether the current selection is within the AllDay area of the SchedulerDayViewElement.

C#
public bool IsAllDayAreaSelection { get; }

The RadScheduler this behavior belongs to.

C#
public RadScheduler Scheduler { get; }

Gets the last selected appointment.

C#
public IEvent SelectedAppointment { get; }

Gets the AppointmentElement which represents the selected appointment.

C#
public AppointmentElement SelectedAppointmentElement { get; }

Gets a read-only list which contains the currently selected appointments.

C#
public ReadOnlyCollection<IEvent> SelectedAppointments { get; }

Gets the id of the resource which contains the current selection.

C#
public EventId SelectedResourceId { get; }

Gets the end date of the current selection range. The value of the property can be less that the value of SelectionStartRange. Derived classes can set a value.

C#
public DateTime SelectionEndDate { get; protected set; }

Gets the start date of the current selection range. The value of the property can be greater that the value of SelectionEndRange. Derived classes can set a value.

C#
public DateTime SelectionStartDate { get; protected set; }

Methods

Gets the logical duration of a cell in the current view. For example: the duration of an AllDay cell will be 1 day and the duration of a cell in day view with the default ScaleFactor will be 60 minutes.

C#
public virtual TimeSpan GetCellDuration()
Returns:

TimeSpan

The durration of a cell in the current view.

Gets the date-time interval that is currently selected. If SelectionStartDate is greater than SelectionEndDate, the method will swap the values and will always return an interval in which the Start is less than or equal to the End.

C#
public DateTimeInterval GetSelectedInterval()
Returns:

DateTimeInterval

Returns a value indicating whether an appointment is in the current selection.

C#
public virtual bool IsAppointmentSelected(IEvent appointment)
Parameters:appointmentIEvent

The appointment.

Returns:

bool

[true] if the appointment is selected, [false] otherwise.

Returns a value indicating whether a cell element is selected.

C#
public virtual bool IsCellSelected(SchedulerCellElement cell)
Parameters:cellSchedulerCellElement

The cell element.

Returns:

bool

[true] if the cell is selected, [false] otherwise.

Returns a value indicating whether a cell with specified parameters is currently selected.

C#
public virtual bool IsDateSelected(DateTime date, TimeSpan duration, EventId resourceId, bool isAllDayAreaCell)
Parameters:dateDateTime

The Date of the cell.

durationTimeSpan

The Duration of the cell.

resourceIdEventId

The ResourceId of the cell.

isAllDayAreaCellbool

A value indicating whether this is an AllDay cell.

Returns:

bool

[true] if the cell is selected, [false] otherwise.

Clears the current appointment selection.

C#
public virtual void ResetAppointmentSelection()

Clears the current cell selection.

C#
public virtual void ResetCellSelection()

Clears both appointment selection and cell selection.

C#
public void ResetSelection()

Selects a given appointment.

C#
public virtual void SelectAppointment(IEvent appointment, bool extend)
Parameters:appointmentIEvent

The appointment to select.

extendbool

Indicates whether the appointment should be added to the current selection or not. If this argument is true and the appointment is already selected, it will be deselected. This argument has no effect if AllowAppointmentsMultiSelect is false.

Selects a given cell element. Selecting a cell will reset the appointment selection.

C#
public virtual void SelectCell(SchedulerCellElement cell, bool extendSelection)
Parameters:cellSchedulerCellElement

The cell element to select.

extendSelectionbool

Indicates whether only the specified cell should be selected or the selection should be extended as if you were holding the Shift key.

Selects a given cell element. Selecting a cell will reset the appointment selection.

C#
public void SelectCell(SchedulerCellElement cell)
Parameters:cellSchedulerCellElement

The cell element to select.

Selects all cells in a specified range.

C#
public virtual void SelectDateRange(DateTime startDate, DateTime endDate, EventId resourceId)
Parameters:startDateDateTime

The start date of the range.

endDateDateTime

The end date of the range.

resourceIdEventId

The id of the resource in which the selection should be performed.

Selects all cells in a specified range.

C#
public virtual void SelectDateRange(DateTime startDate, DateTime endDate)
Parameters:startDateDateTime

The start date of the range.

endDateDateTime

The end date of the range.

Removes an appointment from the current selection.

C#
public virtual void UnselectAppointment(IEvent appointment)
Parameters:appointmentIEvent

The appointment to unselect.