Class
RadDragDropService

Represents a service that manages drag and drop operations with visual feedback, cursor management, and event handling.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class RadDragDropService : RadService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener

Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropService

Derived Classes: AppointmentDraggingBehaviorDetailListViewDragDropServiceGanttViewDragDropServiceLayoutControlDragDropServiceListControlDragDropServiceListViewDragDropServicePivotFieldListDragDropServicePivotGridDragDropServiceRadGridViewDragDropServiceRadPageViewDragDropServiceRadTabbedFormDragDropServiceRadTaskBoardDragDropServiceTileDragDropServiceTreeViewDragDropService

Implements: ICustomTypeDescriptorIDisposableIMessageListenerINotifyPropertyChanged

Inherited Members RadService.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

RadDragDropService()

Initializes a new instance of the RadDragDropService class.

Declaration

cs-api-definition
public RadDragDropService()

Remarks

Sets up default cursors, hint window configuration, and initializes the service with default drag and drop behavior settings.

Fields

beginPoint

Declaration

cs-api-definition
protected Point? beginPoint

Field Value

Point?

messageFilterAdded

Declaration

cs-api-definition
protected bool messageFilterAdded

Field Value

bool

xOutlineFormOffset

Declaration

cs-api-definition
protected int xOutlineFormOffset

Field Value

int

yOutlineFormOffset

Declaration

cs-api-definition
protected int yOutlineFormOffset

Field Value

int

Properties

CanCommit

Determines whether a drop operation will be committed (a valid drop target is found).

Declaration

cs-api-definition
protected bool CanCommit { get; }

Property Value

bool

DropLocation

Gets the current drop location in the context of the current target.

Declaration

cs-api-definition
public Point DropLocation { get; }

Property Value

Point

DropTarget

Gets current drop target, where the mouse cursor points.

Declaration

cs-api-definition
public ISupportDrop DropTarget { get; }

Property Value

ISupportDrop

HintWindow

Gets the Hint window.

Declaration

cs-api-definition
protected RadLayeredWindow HintWindow { get; }

Property Value

RadLayeredWindow

The hint window.

Initialized

Declaration

cs-api-definition
protected bool Initialized { get; }

Property Value

bool

InvalidCursor

Gets or sets the cursor to be used when a valid drop target is hit-tested.

Declaration

cs-api-definition
public Cursor InvalidCursor { get; set; }

Property Value

Cursor

UseDefaultPreview

Determines whether a default preview is generated for a ISupportDrag instance if its GetPreview method returns null.

Declaration

cs-api-definition
public bool UseDefaultPreview { get; set; }

Property Value

bool

ValidCursor

Gets or sets the cursor to be used when a valid drop target is hit-tested.

Declaration

cs-api-definition
public Cursor ValidCursor { get; set; }

Property Value

Cursor

Methods

BeginDrag(Point, ISupportDrag)

Begins a drag pass. Allows for service automation.

Declaration

cs-api-definition
public void BeginDrag(Point mouseBeginPoint, ISupportDrag draggedObject)

Parameters

mouseBeginPoint

Point

The position of the mouse cursor in screen coordinates.

draggedObject

ISupportDrag

An instance of IDraggable that is dragged.

CanStart(object)

Determines whether the service may be started. Validation is as follows:

  1. Check whether Enabled is true.
  2. Check the context through IsContextValid method. An exception is thrown if context is invalid.
  3. Checks the current state - it should be Initial or Stopped.

Declaration

cs-api-definition
protected override bool CanStart(object context)

Parameters

context

object

Returns

bool

Overrides RadService.CanStart(object)

Commit()

Ends the current operation and applies all changes.

Declaration

cs-api-definition
protected override void Commit()

Overrides RadService.Commit()

DisposeManagedResources()

Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.

Declaration

cs-api-definition
protected override void DisposeManagedResources()

Overrides RadObject.DisposeManagedResources()

DoMouseMove(Point)

Mocks a mouse move to a specific point. Allows for service automation.

Declaration

cs-api-definition
public void DoMouseMove(Point mousePos)

Parameters

mousePos

Point

EndDrag()

Ends a drag pass. Allows for service automation.

Declaration

cs-api-definition
public void EndDrag()

EndDrag(Point, RadControl)

Ends a drag pass. Allows for service automation.

Declaration

cs-api-definition
public void EndDrag(Point mouseEndPoint, RadControl targetControl)

Parameters

mouseEndPoint

Point

The end position of the mouse cursor in screen coordinates.

targetControl

RadControl

An instance of RadControl.

GetDropTarget(Point, out Point)

Declaration

cs-api-definition
protected virtual ISupportDrop GetDropTarget(Point mousePosition, out Point resultDropLocation)

Parameters

mousePosition

Point

resultDropLocation

Point

Returns

ISupportDrop

HandleEscKeyDown()

Declaration

cs-api-definition
protected virtual void HandleEscKeyDown()

HandleLeftButtonUp()

Declaration

cs-api-definition
protected virtual void HandleLeftButtonUp()

HandleMouseMove(Point)

Declaration

cs-api-definition
protected virtual void HandleMouseMove(Point mousePos)

Parameters

mousePos

Point

IsDropTargetValid(ISupportDrop)

Declaration

cs-api-definition
protected virtual bool IsDropTargetValid(ISupportDrop dropTarget)

Parameters

dropTarget

ISupportDrop

Returns

bool

OnPreviewDragDrop(RadDropEventArgs)

Declaration

cs-api-definition
protected virtual void OnPreviewDragDrop(RadDropEventArgs e)

Parameters

e

RadDropEventArgs

OnPreviewDragHint(PreviewDragHintEventArgs)

Declaration

cs-api-definition
protected virtual void OnPreviewDragHint(PreviewDragHintEventArgs e)

Parameters

e

PreviewDragHintEventArgs

OnPreviewDragOver(RadDragOverEventArgs)

Declaration

cs-api-definition
protected virtual void OnPreviewDragOver(RadDragOverEventArgs e)

Parameters

e

RadDragOverEventArgs

OnPreviewDragStart(PreviewDragStartEventArgs)

Declaration

cs-api-definition
protected virtual void OnPreviewDragStart(PreviewDragStartEventArgs e)

Parameters

e

PreviewDragStartEventArgs

OnPreviewDropTarget(PreviewDropTargetEventArgs)

Declaration

cs-api-definition
protected virtual void OnPreviewDropTarget(PreviewDropTargetEventArgs e)

Parameters

e

PreviewDropTargetEventArgs

PerformStart()

Performs the core Start logic.

Declaration

cs-api-definition
protected override void PerformStart()

Overrides RadService.PerformStart()

PerformStop()

Stops the service. Performs the core logic.

Declaration

cs-api-definition
protected override void PerformStop()

Overrides RadService.PerformStop()

PrepareContext()

Declaration

cs-api-definition
protected virtual bool PrepareContext()

Returns

bool

RestoreOriginalMouseCursor()

Declaration

cs-api-definition
protected virtual void RestoreOriginalMouseCursor()

SetHintWindowPosition(Point)

Declaration

cs-api-definition
protected virtual void SetHintWindowPosition(Point mousePt)

Parameters

mousePt

Point

ShouldBeginDrag(Point, Point)

Declaration

cs-api-definition
public static bool ShouldBeginDrag(Point current, Point capture)

Parameters

current

Point

capture

Point

Returns

bool

Events

PreviewDragDrop

Declaration

cs-api-definition
public event EventHandler<RadDropEventArgs> PreviewDragDrop

Event Value

EventHandler<RadDropEventArgs>

PreviewDragHint

Declaration

cs-api-definition
public event EventHandler<PreviewDragHintEventArgs> PreviewDragHint

Event Value

EventHandler<PreviewDragHintEventArgs>

PreviewDragOver

Declaration

cs-api-definition
public event EventHandler<RadDragOverEventArgs> PreviewDragOver

Event Value

EventHandler<RadDragOverEventArgs>

PreviewDragStart

Declaration

cs-api-definition
public event EventHandler<PreviewDragStartEventArgs> PreviewDragStart

Event Value

EventHandler<PreviewDragStartEventArgs>

PreviewDropTarget

Declaration

cs-api-definition
public event EventHandler<PreviewDropTargetEventArgs> PreviewDropTarget

Event Value

EventHandler<PreviewDropTargetEventArgs>