Class
SchedulerSelectionBehavior

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:

cs-api-definition
public class SchedulerSelectionBehavior

Inheritance: objectSchedulerSelectionBehavior

Constructors

SchedulerSelectionBehavior(RadScheduler)

Creates a the selection behavior for the specified RadScheduler.

Declaration

cs-api-definition
public SchedulerSelectionBehavior(RadScheduler scheduler)

Parameters

scheduler

RadScheduler

The scheduler this behavior belongs to.

Fields

selectedAppointmentsList

Declaration

cs-api-definition
protected List<IEvent> selectedAppointmentsList

Field Value

List<IEvent>

Properties

CurrentCell

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.

Declaration

cs-api-definition
public TableLayoutPanelCellPosition CurrentCell { get; set; }

Property Value

TableLayoutPanelCellPosition

CurrentCellElement

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

Declaration

cs-api-definition
public SchedulerCellElement CurrentCellElement { get; }

Property Value

SchedulerCellElement

HasAppointmentsSelected

Gets a value indicating whether there is any appointment selected.

Declaration

cs-api-definition
public virtual bool HasAppointmentsSelected { get; }

Property Value

bool

HasCellsSelected

Gets a value indicating whether there is any cell selected.

Declaration

cs-api-definition
public virtual bool HasCellsSelected { get; }

Property Value

bool

IsAllDayAreaSelection

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

Declaration

cs-api-definition
public bool IsAllDayAreaSelection { get; }

Property Value

bool

Scheduler

The RadScheduler this behavior belongs to.

Declaration

cs-api-definition
public RadScheduler Scheduler { get; }

Property Value

RadScheduler

SelectedAppointment

Gets the last selected appointment.

Declaration

cs-api-definition
public IEvent SelectedAppointment { get; }

Property Value

IEvent

SelectedAppointmentElement

Gets the AppointmentElement which represents the selected appointment.

Declaration

cs-api-definition
public AppointmentElement SelectedAppointmentElement { get; }

Property Value

AppointmentElement

SelectedAppointments

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

Declaration

cs-api-definition
public ReadOnlyCollection<IEvent> SelectedAppointments { get; }

Property Value

ReadOnlyCollection<IEvent>

SelectedResourceId

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

Declaration

cs-api-definition
public EventId SelectedResourceId { get; }

Property Value

EventId

SelectionEndDate

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.

Declaration

cs-api-definition
public DateTime SelectionEndDate { get; protected set; }

Property Value

DateTime

SelectionStartDate

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.

Declaration

cs-api-definition
public DateTime SelectionStartDate { get; protected set; }

Property Value

DateTime

Methods

GetCellDuration()

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.

Declaration

cs-api-definition
public virtual TimeSpan GetCellDuration()

Returns

TimeSpan

The durration of a cell in the current view.

GetSelectedInterval()

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.

Declaration

cs-api-definition
public DateTimeInterval GetSelectedInterval()

Returns

DateTimeInterval

IsAppointmentSelected(IEvent)

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

Declaration

cs-api-definition
public virtual bool IsAppointmentSelected(IEvent appointment)

Parameters

appointment

IEvent

The appointment.

Returns

bool

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

IsCellSelected(SchedulerCellElement)

Returns a value indicating whether a cell element is selected.

Declaration

cs-api-definition
public virtual bool IsCellSelected(SchedulerCellElement cell)

Parameters

cell

SchedulerCellElement

The cell element.

Returns

bool

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

IsDateSelected(DateTime, TimeSpan, EventId, bool)

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

Declaration

cs-api-definition
public virtual bool IsDateSelected(DateTime date, TimeSpan duration, EventId resourceId, bool isAllDayAreaCell)

Parameters

date

DateTime

The Date of the cell.

duration

TimeSpan

The Duration of the cell.

resourceId

EventId

The ResourceId of the cell.

isAllDayAreaCell

bool

A value indicating whether this is an AllDay cell.

Returns

bool

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

ResetAppointmentSelection()

Clears the current appointment selection.

Declaration

cs-api-definition
public virtual void ResetAppointmentSelection()

ResetCellSelection()

Clears the current cell selection.

Declaration

cs-api-definition
public virtual void ResetCellSelection()

ResetSelection()

Clears both appointment selection and cell selection.

Declaration

cs-api-definition
public void ResetSelection()

SelectAppointment(IEvent, bool)

Selects a given appointment.

Declaration

cs-api-definition
public virtual void SelectAppointment(IEvent appointment, bool extend)

Parameters

appointment

IEvent

The appointment to select.

extend

bool

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.

SelectCell(SchedulerCellElement)

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

Declaration

cs-api-definition
public void SelectCell(SchedulerCellElement cell)

Parameters

cell

SchedulerCellElement

The cell element to select.

SelectCell(SchedulerCellElement, bool)

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

Declaration

cs-api-definition
public virtual void SelectCell(SchedulerCellElement cell, bool extendSelection)

Parameters

cell

SchedulerCellElement

The cell element to select.

extendSelection

bool

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

SelectDateRange(DateTime, DateTime)

Selects all cells in a specified range.

Declaration

cs-api-definition
public virtual void SelectDateRange(DateTime startDate, DateTime endDate)

Parameters

startDate

DateTime

The start date of the range.

endDate

DateTime

The end date of the range.

SelectDateRange(DateTime, DateTime, EventId)

Selects all cells in a specified range.

Declaration

cs-api-definition
public virtual void SelectDateRange(DateTime startDate, DateTime endDate, EventId resourceId)

Parameters

startDate

DateTime

The start date of the range.

endDate

DateTime

The end date of the range.

resourceId

EventId

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

UnselectAppointment(IEvent)

Removes an appointment from the current selection.

Declaration

cs-api-definition
public virtual void UnselectAppointment(IEvent appointment)

Parameters

appointment

IEvent

The appointment to unselect.