Manages appointment drag feedback, view navigation, and the commit or cancellation of a drag operation.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.Scheduler.dll
Syntax:
public class AppointmentDraggingBehavior : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceAppointmentDraggingBehavior...
Implements:
Inherited Members
Constructors
Initializes the behavior for the specified Scheduler.
public AppointmentDraggingBehavior(RadScheduler scheduler)
The Scheduler whose appointments can be dragged.
Initializes the behavior with the visual element that owns appointment feedback.
public AppointmentDraggingBehavior(SchedulerVisualElement activeOwner)
The Scheduler visual element that initially owns the feedback.
Properties
Gets the active feedback.
public DragFeedbackElement ActiveFeedback { get; }
Gets the behavior's active owner.
public SchedulerVisualElement ActiveOwner { get; }
Gets or sets a value indicating whether the appointment areas in DayView should be automatically scrolled when dragging off their bounds.
public bool AutoScrollDayViewOnDrag { get; set; }
Gets or sets the minimum time interval between automatic view navigations.
public TimeSpan DragNavigationInterval { get; set; }
Gets or sets the offset from the bounds of the control in pixels after which the automatic view navigation will be triggered.
public int DragNavigationOffset { get; set; }
Indicates whether there is an active drag operation.
public bool IsDragging { get; }
The RadScheduler that owns the behaviors.
public RadScheduler Scheduler { get; }
Gets or sets a value indicating whether a prompt dialog box should be shown when the user is about to create occurrence exception via drag and drop.
public bool ShowCreateExceptionDialog { get; set; }
Gets or sets a value indicating whether a message box should be shown when an occurrence is dragged to an invalid location.
public bool ShowOccurrenceValidationMessages { get; set; }
Methods
Adds the active feedback to the active owner.
Request move operation.
public bool BeginDrag(SchedulerVisualElement newOwner, AppointmentElement appointment)
Starts dragging only when feedback and an owner exist, the appointment and view permit moving, and the Scheduler is editable.
Creates a new appointment feedback of a given appointment.
public virtual DragFeedbackElement CreateFeedback(RadScheduler scheduler, SchedulerView view, AppointmentElement appointment)
Handles dragging the active feedback to a given point.
public void DoDragOver(Point controlDropLocation)
The destination point in control coordinates.
Handles the Drop operation.
public virtual void Drop()
Gets a DayViewAllDayHeader at a specified location.
protected DayViewAllDayHeader GetAllDayHeaderAtPoint(Point location)
The location in control coordinates.
Returns:The DayViewAllDayHeader at that location.
Gets a SchedulerCellElement at a specified location.
protected SchedulerCellElement GetCellAtPoint(Point location)
The location in control coordinates.
Returns:The SchedulerCellElement at that location.
Gets the destination date for an appointment that was dropped on a given cell.
protected virtual DateTime GetCellDate(SchedulerCellElement cell)
The SchedulerCellElement.
Returns:The destination date.
Gets a DayViewAppointmentsTable at a specified location.
protected DayViewAppointmentsTable GetDayViewTableAtPoint(Point location)
The location in control coordinates.
Returns:The DayViewAppointmentsTable at that location.
Gets a specific feedback.
public DragFeedbackElement GetFeedback(SchedulerVisualElement feedbackOwnerElement)
Gets a MonthViewAreaElement at a specified location.
protected MonthViewAreaElement GetMonthViewAreaAtPoint(Point location)
The location in control coordinates.
Returns:The MonthViewAreaElement at that location.
Gets a TimelineAppointmentsPresenter at a specified location.
protected TimelineAppointmentsPresenter GetTimelinePresenterAtPoint(Point location)
The location in control coordinates.
Returns:The TimelineAppointmentsPresenter at that location.
Scrolls day-view content during a drag and checks whether moving outside the control should navigate to another view.
protected override void HandleMouseMove(Point mousePos)
The current pointer position in screen coordinates.
Overrides:
Navigates the active view when the pointer passes the expanded control bounds, subject to the navigation interval and Scheduler settings.
Hides the active feedbacks.
Associates the feedback with the original appointment, initializes its appearance and bounds, then raises the feedback-initialized event.
protected virtual void InitializeSettings(AppointmentElement appointment)
The visual appointment being dragged.
Gets whether the element is found in the owners collection.
public bool IsElementOwner(SchedulerVisualElement owner)
Moves the feedback to a specific date in a specific resource.
public virtual bool Move(DateTime newDate, SchedulerCellElement cell, SchedulerVisualElement newOwner)
The destination date.
cellSchedulerCellElementThe destination cell.
newOwnerSchedulerVisualElementThe destination visual element.
Returns:[true] if the move was performed, [false] otherwise
Moves the active feedback to a new owner.
public virtual void MoveFeedback(SchedulerVisualElement newOwner)
The new owner of the feedback.
Raises AppointmentDropped after the appointment is committed at its drop location.
protected virtual void OnAppointmentDropped(AppointmentMovedEventArgs args)
The completed move details.
Raises AppointmentDropping before the appointment is committed at the drop location.
protected virtual void OnAppointmentDropping(AppointmentMovingEventArgs args)
The proposed destination and cancellation state.
Raises AppointmentMoved after the feedback has moved to a new date or owner.
protected virtual void OnAppointmentMoved()
Raises AppointmentMoving before the feedback is moved; handlers can cancel the move.
protected virtual void OnAppointmentMovingEventArgs(AppointmentMovingEventArgs args)
The proposed destination and cancellation state.
Raises FeedbackCreating so handlers can customize or supply the feedback element.
protected virtual void OnFeedbackCreating(FeedbackCreatingEventArgs args)
The event data that can provide a custom feedback element.
Raises FeedbackInitialized after the drag feedback has been initialized.
protected virtual void OnInitializing(FeedbackInitializingEventArgs args)
The initialized feedback and event data.
Commits the appointment drop when no earlier handler has handled the drop event.
protected override void OnPreviewDragDrop(RadDropEventArgs e)
The drop event data.
Overrides:
Suppresses the drag service's default hint because the Scheduler displays appointment feedback instead.
protected override void OnPreviewDragHint(PreviewDragHintEventArgs e)
The preview-hint event data.
Overrides:
Routes drag-over positions inside this Scheduler to DoDragOver(Point) so the feedback follows the target cell.
protected override void OnPreviewDragOver(RadDragOverEventArgs e)
The preview drag-over event data.
Overrides:
Restores the original appointment's visibility, closes pending collection updates, and clears drag feedback and hover state.
protected override void PerformStop()
Overrides:
Hides the original appointment and creates a temporary event carrying its dates, status, background, all-day state, and resources for drag feedback.
Removes the visual feedback. Cancels the drag operation.
public virtual bool RemoveFeedback(SchedulerVisualElement owner)
Restores the visible appointment elements associated with the specified event.
protected void ResetAppointmentVisibility(IEvent appointment)
The event whose visual elements should be shown again.
Clears mouse-hover flags from the cells in the current view after feedback moves or the drag stops.
protected virtual void ResetCellsHoverState()
Applies a visibility override to every visual appointment element for the event in the current view.
protected void SetAppointmentVisibility(IEvent appointment, ElementVisibility visibility)
The event whose visual elements are updated.
visibilityElementVisibilityThe visibility to apply.
Rejects recurring-occurrence drops that collide with or skip another occurrence and, when configured, asks before creating an exception.
protected virtual bool ValidateOccurrenceDropTarget(DateTime targetStartDate, DateTime targetEndDate, bool allDay)
The proposed start date.
targetEndDateDateTimeThe proposed end date.
allDayboolWhether the dragged occurrence is an all-day appointment.
Returns:true if the occurrence may be dropped at the proposed time.
Events
Occurs when drag drop has finished.
public event EventHandler<AppointmentMovedEventArgs> AppointmentDropped
Occurs when drag drop is finishing.
public event EventHandler<AppointmentMovingEventArgs> AppointmentDropping
Occurs when an appointment is moved.
public event EventHandler AppointmentMoved
Occurs when an appointment is moving.
public event EventHandler<AppointmentMovingEventArgs> AppointmentMoving
Occurs when the feedback is creating.
public event EventHandler<FeedbackCreatingEventArgs> FeedbackCreating
Occurs when the feedback is initialized.
public event EventHandler<FeedbackInitializingEventArgs> FeedbackInitialized