ClassSchedulerSelectionBehavior
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:
public class SchedulerSelectionBehavior
Inheritance: objectSchedulerSelectionBehavior
Constructors
SchedulerSelectionBehavior(RadScheduler)
Creates a the selection behavior for the specified RadScheduler.
Declaration
public SchedulerSelectionBehavior(RadScheduler scheduler)
Parameters
scheduler
The scheduler this behavior belongs to.
Fields
selectedAppointmentsList
Declaration
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
public TableLayoutPanelCellPosition CurrentCell { get; set; }
Property Value
CurrentCellElement
Gets the SchedulerCellElement which stands on the coordinates provided by the CurrentCell property.
Declaration
public SchedulerCellElement CurrentCellElement { get; }
Property Value
HasAppointmentsSelected
Gets a value indicating whether there is any appointment selected.
Declaration
public virtual bool HasAppointmentsSelected { get; }
Property Value
HasCellsSelected
Gets a value indicating whether there is any cell selected.
IsAllDayAreaSelection
Gets a value indicating whether the current selection is within the AllDay area of the SchedulerDayViewElement.
Scheduler
The RadScheduler this behavior belongs to.
SelectedAppointment
Gets the last selected appointment.
SelectedAppointmentElement
Gets the AppointmentElement which represents the selected appointment.
Declaration
public AppointmentElement SelectedAppointmentElement { get; }
Property Value
SelectedAppointments
Gets a read-only list which contains the currently selected appointments.
Declaration
public ReadOnlyCollection<IEvent> SelectedAppointments { get; }
Property Value
SelectedResourceId
Gets the id of the resource which contains the current selection.
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
public DateTime SelectionEndDate { get; protected set; }
Property Value
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
public DateTime SelectionStartDate { get; protected set; }
Property Value
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
public virtual TimeSpan GetCellDuration()
Returns
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
public DateTimeInterval GetSelectedInterval()
Returns
IsAppointmentSelected(IEvent)
Returns a value indicating whether an appointment is in the current selection.
IsCellSelected(SchedulerCellElement)
Returns a value indicating whether a cell element is selected.
Declaration
public virtual bool IsCellSelected(SchedulerCellElement cell)
Parameters
cell
The cell element.
Returns
[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
public virtual bool IsDateSelected(DateTime date, TimeSpan duration, EventId resourceId, bool isAllDayAreaCell)
Parameters
date
The Date of the cell.
duration
The Duration of the cell.
resourceId
The ResourceId of the cell.
isAllDayAreaCell
A value indicating whether this is an AllDay cell.
Returns
[true] if the cell is selected, [false] otherwise.
ResetAppointmentSelection()
Clears the current appointment selection.
Declaration
public virtual void ResetAppointmentSelection()
ResetCellSelection()
Clears the current cell selection.
Declaration
public virtual void ResetCellSelection()
ResetSelection()
Clears both appointment selection and cell selection.
Declaration
public void ResetSelection()
SelectAppointment(IEvent, bool)
Selects a given appointment.
Declaration
public virtual void SelectAppointment(IEvent appointment, bool extend)
Parameters
appointment
The appointment to select.
extend
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
public void SelectCell(SchedulerCellElement cell)
Parameters
cell
The cell element to select.
SelectCell(SchedulerCellElement, bool)
Selects a given cell element. Selecting a cell will reset the appointment selection.
Declaration
public virtual void SelectCell(SchedulerCellElement cell, bool extendSelection)
Parameters
cell
The cell element to select.
extendSelection
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.
SelectDateRange(DateTime, DateTime, EventId)
Selects all cells in a specified range.
Declaration
public virtual void SelectDateRange(DateTime startDate, DateTime endDate, EventId resourceId)
Parameters
startDate
The start date of the range.
endDate
The end date of the range.
resourceId
The id of the resource in which the selection should be performed.
UnselectAppointment(IEvent)
Removes an appointment from the current selection.
Declaration
public virtual void UnselectAppointment(IEvent appointment)
Parameters
appointment
The appointment to unselect.