Handles dragging and reordering list-view items, including transfers between list views.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class ListViewDragDropService : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceListViewDragDropService...
Implements:
Inherited Members
Constructors
Initializes the drag-drop service for a list-view element.
public ListViewDragDropService(RadListViewElement owner)
The list-view element whose items are dragged.
Properties
Gets the item used to start the current drag operation.
public ListViewDataItem DraggedItem { get; }
Gets the selected items included in the current multi-item drag, or null when a single item is dragged.
public List<ListViewDataItem> DraggedItems { get; }
Gets the list-view element that owns this service.
public RadListViewElement Owner { get; }
Methods
Disposes the layered drag-hint window, if one exists.
protected virtual void DisposeDragHint()
Gets the size required by the owning view's drag hint.
protected virtual Size GetDragHintSize(ISupportDrop dropTarget)
The current drop target.
Returns:The drag-hint size in pixels.
Reorders the dragged item or items within the owning list view.
protected virtual void HandleDragDrop(RadDropEventArgs e)
The drop data used to determine the target item and insertion position.
Transfers the dragged item or items to another list view.
protected virtual void HandleDropBetweenListViews(RadDropEventArgs e)
The drop data used to determine the target item and insertion position.
Updates the drag hint and scrolls the list when the pointer moves beyond its viewport.
protected override void HandleMouseMove(Point mousePos)
The pointer position in screen coordinates.
Overrides:
Rejects the dragged item as its own drop target and accepts list-view elements as targets.
protected override bool IsDropTargetValid(ISupportDrop dropTarget)
The proposed drop target.
Returns:Overrides:
Runs the built-in item move or transfer when the drop has not been handled by application code.
protected override void OnPreviewDragDrop(RadDropEventArgs e)
The drop event data.
Overrides:
Built-in movement is skipped for data-bound lists. Grouped or sorted lists display a warning; handle
PreviewDragDropand mark the event handled to supply custom behavior.
Releases the drag hint when the preview target rejects the drop.
protected override void OnPreviewDragOver(RadDragOverEventArgs e)
The drag-over event data.
Overrides:
Captures the dragged item, collects selected items for a multi-item drag, and prepares the drag hint.
protected override void PerformStart()
Overrides:
Clears the current drag items and releases the drag-hint window.
protected override void PerformStop()
Overrides:
Creates the layered window used to display the view's drag hint.
protected virtual void PrepareDragHint()
Positions or hides the visual hint for the current drop target.
protected virtual void UpdateDragHintLocation(Point mousePosition)
The pointer position in screen coordinates.