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
Creates a the selection behavior for the specified RadScheduler.
public SchedulerSelectionBehavior(RadScheduler scheduler)
The scheduler this behavior belongs to.
Fields
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.
public TableLayoutPanelCellPosition CurrentCell { get; set; }
Gets the SchedulerCellElement which stands on the coordinates provided by the CurrentCell property.
public SchedulerCellElement CurrentCellElement { get; }
Gets a value indicating whether there is any appointment selected.
public virtual bool HasAppointmentsSelected { get; }
Gets a value indicating whether there is any cell selected.
public virtual bool HasCellsSelected { get; }
Gets a value indicating whether the current selection is within the AllDay area of the SchedulerDayViewElement.
public bool IsAllDayAreaSelection { get; }
The RadScheduler this behavior belongs to.
public RadScheduler Scheduler { get; }
Gets the last selected appointment.
public IEvent SelectedAppointment { get; }
Gets the AppointmentElement which represents the selected appointment.
public AppointmentElement SelectedAppointmentElement { get; }
Gets a read-only list which contains the currently selected appointments.
public ReadOnlyCollection<IEvent> SelectedAppointments { get; }
Gets the id of the resource which contains the current selection.
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.
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.
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.
public virtual TimeSpan GetCellDuration()
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.
Returns a value indicating whether a cell element is selected.
public virtual bool IsCellSelected(SchedulerCellElement cell)
The cell element.
Returns:[true] if the cell is selected, [false] otherwise.
Returns a value indicating whether a cell with specified parameters is currently selected.
public virtual bool IsDateSelected(DateTime date, TimeSpan duration, EventId resourceId, bool isAllDayAreaCell)
The Date of the cell.
durationTimeSpanThe Duration of the cell.
resourceIdEventIdThe ResourceId of the cell.
isAllDayAreaCellboolA value indicating whether this is an AllDay cell.
Returns:[true] if the cell is selected, [false] otherwise.
Clears the current appointment selection.
public virtual void ResetAppointmentSelection()
Clears the current cell selection.
public virtual void ResetCellSelection()
Clears both appointment selection and cell selection.
public void ResetSelection()
Selects a given appointment.
public virtual void SelectAppointment(IEvent appointment, bool extend)
The appointment to select.
extendboolIndicates 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.
public virtual void SelectCell(SchedulerCellElement cell, bool extendSelection)
The cell element to select.
extendSelectionboolIndicates 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.
public void SelectCell(SchedulerCellElement cell)
The cell element to select.
Selects all cells in a specified range.
Removes an appointment from the current selection.
public virtual void UnselectAppointment(IEvent appointment)
The appointment to unselect.