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