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:
public class RadDragDropService : RadService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropService
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadDragDropService class.
public RadDragDropService()
Sets up default cursors, hint window configuration, and initializes the service with default drag and drop behavior settings.
Fields
protected Point? beginPoint
protected bool messageFilterAdded
protected int xOutlineFormOffset
protected int yOutlineFormOffset
Properties
Determines whether a drop operation will be committed (a valid drop target is found).
protected bool CanCommit { get; }
Gets the current drop location in the context of the current target.
public Point DropLocation { get; }
Gets current drop target, where the mouse cursor points.
public ISupportDrop DropTarget { get; }
Gets the Hint window.
protected RadLayeredWindow HintWindow { get; }
The hint window.
protected bool Initialized { get; }
Gets or sets the cursor to be used when a valid drop target is hit-tested.
public Cursor InvalidCursor { get; set; }
Determines whether a default preview is generated for a ISupportDrag instance if its GetPreview method returns null.
public bool UseDefaultPreview { get; set; }
Gets or sets the cursor to be used when a valid drop target is hit-tested.
public Cursor ValidCursor { get; set; }
Methods
Begins a drag pass. Allows for service automation.
public void BeginDrag(Point mouseBeginPoint, ISupportDrag draggedObject)
The position of the mouse cursor in screen coordinates.
draggedObjectISupportDragAn instance of IDraggable that is dragged.
Determines whether the service may be started. Validation is as follows:
- Check whether Enabled is true.
- Check the context through IsContextValid method. An exception is thrown if context is invalid.
- Checks the current state - it should be Initial or Stopped.
Ends the current operation and applies all changes.
protected override void Commit()
Overrides:
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
protected override void DisposeManagedResources()
Overrides:
Mocks a mouse move to a specific point. Allows for service automation.
Ends a drag pass. Allows for service automation.
public void EndDrag()
Ends a drag pass. Allows for service automation.
public void EndDrag(Point mouseEndPoint, RadControl targetControl)
The end position of the mouse cursor in screen coordinates.
targetControlRadControlAn instance of RadControl.
protected virtual void HandleEscKeyDown()
protected virtual void HandleLeftButtonUp()
protected virtual bool IsDropTargetValid(ISupportDrop dropTarget)
protected virtual void OnPreviewDragHint(PreviewDragHintEventArgs e)
protected virtual void OnPreviewDragOver(RadDragOverEventArgs e)
protected virtual void OnPreviewDragStart(PreviewDragStartEventArgs e)
protected virtual void OnPreviewDropTarget(PreviewDropTargetEventArgs e)
Performs the core Start logic.
protected override void PerformStart()
Overrides:
Stops the service. Performs the core logic.
protected override void PerformStop()
Overrides:
protected virtual void RestoreOriginalMouseCursor()
Events
public event EventHandler<RadDropEventArgs> PreviewDragDrop
public event EventHandler<PreviewDragHintEventArgs> PreviewDragHint
public event EventHandler<RadDragOverEventArgs> PreviewDragOver
public event EventHandler<PreviewDragStartEventArgs> PreviewDragStart
public event EventHandler<PreviewDropTargetEventArgs> PreviewDropTarget