New to Telerik UI for WinForms? Start a free 30-day trial

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:

C#
public class AppointmentDraggingBehavior : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener

Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceAppointmentDraggingBehavior...

Implements: ICustomTypeDescriptorIDisposableIMessageListenerINotifyPropertyChanged

Inherited Members RadDragDropService.messageFilterAddedRadDragDropService.xOutlineFormOffsetRadDragDropService.yOutlineFormOffsetRadDragDropService.beginPointRadDragDropService.DisposeManagedResources()RadDragDropService.HandleLeftButtonUp()RadDragDropService.HandleEscKeyDown()RadDragDropService.PrepareContext()RadDragDropService.IsDropTargetValid(ISupportDrop)RadDragDropService.RestoreOriginalMouseCursor()RadDragDropService.SetHintWindowPosition(Point)RadDragDropService.ShouldBeginDrag(Point, Point)RadDragDropService.OnPreviewDragStart(PreviewDragStartEventArgs)RadDragDropService.PerformStart()RadDragDropService.Commit()RadDragDropService.GetDropTarget(Point, out Point)RadDragDropService.OnPreviewDropTarget(PreviewDropTargetEventArgs)RadDragDropService.BeginDrag(Point, ISupportDrag)RadDragDropService.EndDrag(Point, RadControl)RadDragDropService.EndDrag()RadDragDropService.DoMouseMove(Point)RadDragDropService.CanCommitRadDragDropService.ValidCursorRadDragDropService.InitializedRadDragDropService.InvalidCursorRadDragDropService.UseDefaultPreviewRadDragDropService.DropTargetRadDragDropService.DropLocationRadDragDropService.HintWindowRadDragDropService.PreviewDragDropRadDragDropService.PreviewDragOverRadDragDropService.PreviewDropTargetRadDragDropService.PreviewDragStartRadDragDropService.PreviewDragHintRadService.CanOperate()RadService.Start(object)RadService.Stop(bool)RadService.Pause()RadService.Resume()RadService.OnStarted()RadService.OnStarting(RadServiceStartingEventArgs)RadService.OnStopped()RadService.OnStopping(RadServiceStoppingEventArgs)RadService.IsContextValid(object)RadService.Abort()RadService.PerformResume()RadService.PerformPause()RadService.SetContext(object)RadService.OnEnabledChanged()RadService.ContextRadService.AvailableAtDesignTimeRadService.StateRadService.NameRadService.EnabledRadService.StartingRadService.StartedRadService.StoppingRadService.StoppedRadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes the behavior for the specified Scheduler.

C#
public AppointmentDraggingBehavior(RadScheduler scheduler)
Parameters:schedulerRadScheduler

The Scheduler whose appointments can be dragged.

Initializes the behavior with the visual element that owns appointment feedback.

C#
public AppointmentDraggingBehavior(SchedulerVisualElement activeOwner)
Parameters:activeOwnerSchedulerVisualElement

The Scheduler visual element that initially owns the feedback.

Properties

Gets the active feedback.

C#
public DragFeedbackElement ActiveFeedback { get; }

Gets the behavior's active owner.

C#
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.

C#
public bool AutoScrollDayViewOnDrag { get; set; }

Gets or sets the minimum time interval between automatic view navigations.

C#
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.

C#
public int DragNavigationOffset { get; set; }

Indicates whether there is an active drag operation.

C#
public bool IsDragging { get; }

The RadScheduler that owns the behaviors.

C#
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.

C#
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.

C#
public bool ShowOccurrenceValidationMessages { get; set; }

Methods

Adds the active feedback to the active owner.

C#
public virtual bool AddToOwnerCollection()
Returns:

bool

Request move operation.

C#
public bool BeginDrag(SchedulerVisualElement newOwner, AppointmentElement appointment)
Parameters:newOwnerSchedulerVisualElementappointmentAppointmentElementReturns:

bool

Starts dragging only when feedback and an owner exist, the appointment and view permit moving, and the Scheduler is editable.

C#
protected override bool CanStart(object context)
Parameters:contextobject

The drag context supplied by the drag-and-drop service.

Returns:

bool

true when the current feedback can be dragged.

Overrides: RadDragDropService.CanStart(object)

Creates a new appointment feedback of a given appointment.

C#
public virtual DragFeedbackElement CreateFeedback(RadScheduler scheduler, SchedulerView view, AppointmentElement appointment)
Parameters:schedulerRadSchedulerviewSchedulerViewappointmentAppointmentElementReturns:

DragFeedbackElement

Handles dragging the active feedback to a given point.

C#
public void DoDragOver(Point controlDropLocation)
Parameters:controlDropLocationPoint

The destination point in control coordinates.

Handles the Drop operation.

C#
public virtual void Drop()

Gets a DayViewAllDayHeader at a specified location.

C#
protected DayViewAllDayHeader GetAllDayHeaderAtPoint(Point location)
Parameters:locationPoint

The location in control coordinates.

Returns:

DayViewAllDayHeader

The DayViewAllDayHeader at that location.

Gets a SchedulerCellElement at a specified location.

C#
protected SchedulerCellElement GetCellAtPoint(Point location)
Parameters:locationPoint

The location in control coordinates.

Returns:

SchedulerCellElement

The SchedulerCellElement at that location.

Gets the destination date for an appointment that was dropped on a given cell.

C#
protected virtual DateTime GetCellDate(SchedulerCellElement cell)
Parameters:cellSchedulerCellElement

The SchedulerCellElement.

Returns:

DateTime

The destination date.

Gets a DayViewAppointmentsTable at a specified location.

C#
protected DayViewAppointmentsTable GetDayViewTableAtPoint(Point location)
Parameters:locationPoint

The location in control coordinates.

Returns:

DayViewAppointmentsTable

The DayViewAppointmentsTable at that location.

Gets a specific feedback.

C#
public DragFeedbackElement GetFeedback(SchedulerVisualElement feedbackOwnerElement)
Parameters:feedbackOwnerElementSchedulerVisualElementReturns:

DragFeedbackElement

Gets a MonthViewAreaElement at a specified location.

C#
protected MonthViewAreaElement GetMonthViewAreaAtPoint(Point location)
Parameters:locationPoint

The location in control coordinates.

Returns:

MonthViewAreaElement

The MonthViewAreaElement at that location.

Gets a TimelineAppointmentsPresenter at a specified location.

C#
protected TimelineAppointmentsPresenter GetTimelinePresenterAtPoint(Point location)
Parameters:locationPoint

The location in control coordinates.

Returns:

TimelineAppointmentsPresenter

The TimelineAppointmentsPresenter at that location.

Scrolls day-view content during a drag and checks whether moving outside the control should navigate to another view.

C#
protected override void HandleMouseMove(Point mousePos)
Parameters:mousePosPoint

The current pointer position in screen coordinates.

Overrides: RadDragDropService.HandleMouseMove(Point)

Navigates the active view when the pointer passes the expanded control bounds, subject to the navigation interval and Scheduler settings.

C#
protected virtual void HandleMouseMoveOutsideControlBounds(Point mousePos, Rectangle controlRect)
Parameters:mousePosPoint

The pointer position in screen coordinates.

controlRectRectangle

The control bounds expanded by the configured navigation offset.

Hides the active feedbacks.

C#
protected virtual bool HideFeedbacks()
Returns:

bool

[true] if successful, [false] otherwise

Associates the feedback with the original appointment, initializes its appearance and bounds, then raises the feedback-initialized event.

C#
protected virtual void InitializeSettings(AppointmentElement appointment)
Parameters:appointmentAppointmentElement

The visual appointment being dragged.

Gets whether the element is found in the owners collection.

C#
public bool IsElementOwner(SchedulerVisualElement owner)
Parameters:ownerSchedulerVisualElementReturns:

bool

Gets whether this is a valid drag operation.

C#
public virtual bool IsRealDrag(Point mouseOffsetPosition, Point mouseDownPosition)
Parameters:mouseOffsetPositionPointmouseDownPositionPointReturns:

bool

Moves the feedback to a specific date in a specific resource.

C#
public virtual bool Move(DateTime newDate, SchedulerCellElement cell, SchedulerVisualElement newOwner)
Parameters:newDateDateTime

The destination date.

cellSchedulerCellElement

The destination cell.

newOwnerSchedulerVisualElement

The destination visual element.

Returns:

bool

[true] if the move was performed, [false] otherwise

Moves the active feedback to a new owner.

C#
public virtual void MoveFeedback(SchedulerVisualElement newOwner)
Parameters:newOwnerSchedulerVisualElement

The new owner of the feedback.

Raises AppointmentDropped after the appointment is committed at its drop location.

C#
protected virtual void OnAppointmentDropped(AppointmentMovedEventArgs args)
Parameters:argsAppointmentMovedEventArgs

The completed move details.

Raises AppointmentDropping before the appointment is committed at the drop location.

C#
protected virtual void OnAppointmentDropping(AppointmentMovingEventArgs args)
Parameters:argsAppointmentMovingEventArgs

The proposed destination and cancellation state.

Raises AppointmentMoved after the feedback has moved to a new date or owner.

C#
protected virtual void OnAppointmentMoved()

Raises AppointmentMoving before the feedback is moved; handlers can cancel the move.

C#
protected virtual void OnAppointmentMovingEventArgs(AppointmentMovingEventArgs args)
Parameters:argsAppointmentMovingEventArgs

The proposed destination and cancellation state.

Raises FeedbackCreating so handlers can customize or supply the feedback element.

C#
protected virtual void OnFeedbackCreating(FeedbackCreatingEventArgs args)
Parameters:argsFeedbackCreatingEventArgs

The event data that can provide a custom feedback element.

Raises FeedbackInitialized after the drag feedback has been initialized.

C#
protected virtual void OnInitializing(FeedbackInitializingEventArgs args)
Parameters:argsFeedbackInitializingEventArgs

The initialized feedback and event data.

Commits the appointment drop when no earlier handler has handled the drop event.

C#
protected override void OnPreviewDragDrop(RadDropEventArgs e)
Parameters:eRadDropEventArgs

The drop event data.

Overrides: RadDragDropService.OnPreviewDragDrop(RadDropEventArgs)

Suppresses the drag service's default hint because the Scheduler displays appointment feedback instead.

C#
protected override void OnPreviewDragHint(PreviewDragHintEventArgs e)
Parameters:ePreviewDragHintEventArgs

The preview-hint event data.

Overrides: RadDragDropService.OnPreviewDragHint(PreviewDragHintEventArgs)

Routes drag-over positions inside this Scheduler to DoDragOver(Point) so the feedback follows the target cell.

C#
protected override void OnPreviewDragOver(RadDragOverEventArgs e)
Parameters:eRadDragOverEventArgs

The preview drag-over event data.

Overrides: RadDragDropService.OnPreviewDragOver(RadDragOverEventArgs)

Restores the original appointment's visibility, closes pending collection updates, and clears drag feedback and hover state.

C#
protected override void PerformStop()

Overrides: RadDragDropService.PerformStop()

Hides the original appointment and creates a temporary event carrying its dates, status, background, all-day state, and resources for drag feedback.

C#
protected virtual IEvent PrepareAppointment(IEvent appointment)
Parameters:appointmentIEvent

The appointment being dragged.

Returns:

IEvent

The temporary event used to create drag feedback.

Removes the visual feedback. Cancels the drag operation.

C#
public virtual bool RemoveFeedback(SchedulerVisualElement owner)
Parameters:ownerSchedulerVisualElementReturns:

bool

Restores the visible appointment elements associated with the specified event.

C#
protected void ResetAppointmentVisibility(IEvent appointment)
Parameters:appointmentIEvent

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.

C#
protected virtual void ResetCellsHoverState()

Applies a visibility override to every visual appointment element for the event in the current view.

C#
protected void SetAppointmentVisibility(IEvent appointment, ElementVisibility visibility)
Parameters:appointmentIEvent

The event whose visual elements are updated.

visibilityElementVisibility

The visibility to apply.

Rejects recurring-occurrence drops that collide with or skip another occurrence and, when configured, asks before creating an exception.

C#
protected virtual bool ValidateOccurrenceDropTarget(DateTime targetStartDate, DateTime targetEndDate, bool allDay)
Parameters:targetStartDateDateTime

The proposed start date.

targetEndDateDateTime

The proposed end date.

allDaybool

Whether the dragged occurrence is an all-day appointment.

Returns:

bool

true if the occurrence may be dropped at the proposed time.

Events

Occurs when drag drop has finished.

C#
public event EventHandler<AppointmentMovedEventArgs> AppointmentDropped

Occurs when drag drop is finishing.

C#
public event EventHandler<AppointmentMovingEventArgs> AppointmentDropping

Occurs when an appointment is moved.

C#
public event EventHandler AppointmentMoved

Occurs when an appointment is moving.

C#
public event EventHandler<AppointmentMovingEventArgs> AppointmentMoving

Occurs when the feedback is creating.

C#
public event EventHandler<FeedbackCreatingEventArgs> FeedbackCreating

Occurs when the feedback is initialized.

C#
public event EventHandler<FeedbackInitializingEventArgs> FeedbackInitialized
In this article
DefinitionConstructorsAppointmentDraggingBehavior(RadScheduler)AppointmentDraggingBehavior(SchedulerVisualElement)PropertiesActiveFeedbackActiveOwnerAutoScrollDayViewOnDragDragNavigationIntervalDragNavigationOffsetIsDraggingSchedulerShowCreateExceptionDialogShowOccurrenceValidationMessagesMethodsAddToOwnerCollection()BeginDrag(SchedulerVisualElement, AppointmentElement)CanStart(object)CreateFeedback(RadScheduler, SchedulerView, AppointmentElement)DoDragOver(Point)Drop()GetAllDayHeaderAtPoint(Point)GetCellAtPoint(Point)GetCellDate(SchedulerCellElement)GetDayViewTableAtPoint(Point)GetFeedback(SchedulerVisualElement)GetMonthViewAreaAtPoint(Point)GetTimelinePresenterAtPoint(Point)HandleMouseMove(Point)HandleMouseMoveOutsideControlBounds(Point, Rectangle)HideFeedbacks()InitializeSettings(AppointmentElement)IsElementOwner(SchedulerVisualElement)IsRealDrag(Point, Point)Move(DateTime, SchedulerCellElement, SchedulerVisualElement)MoveFeedback(SchedulerVisualElement)OnAppointmentDropped(AppointmentMovedEventArgs)OnAppointmentDropping(AppointmentMovingEventArgs)OnAppointmentMoved()OnAppointmentMovingEventArgs(AppointmentMovingEventArgs)OnFeedbackCreating(FeedbackCreatingEventArgs)OnInitializing(FeedbackInitializingEventArgs)OnPreviewDragDrop(RadDropEventArgs)OnPreviewDragHint(PreviewDragHintEventArgs)OnPreviewDragOver(RadDragOverEventArgs)PerformStop()PrepareAppointment(IEvent)RemoveFeedback(SchedulerVisualElement)ResetAppointmentVisibility(IEvent)ResetCellsHoverState()SetAppointmentVisibility(IEvent, ElementVisibility)ValidateOccurrenceDropTarget(DateTime, DateTime, bool)EventsAppointmentDroppedAppointmentDroppingAppointmentMovedAppointmentMovingFeedbackCreatingFeedbackInitialized
Not finding the help you need?
Contact Support