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

Handles drag-and-drop of selected items between unbound list elements and displays drop-position feedback.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

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

Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceListControlDragDropService...

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.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 service for the list element that starts item drags.

C#
public ListControlDragDropService(RadListElement owner)
Parameters:ownerRadListElement

The source list element.

Methods

Determines whether the drop-position hint is allowed at the current vertical pointer position.

C#
protected virtual bool CanShowDropHint(Point mousePosition)
Parameters:mousePositionPoint

The current pointer position in screen coordinates.

Returns:

bool

false when the drop target is not a list or the pointer's list-relative Y coordinate is between one-third and two-thirds of the target's ItemHeight.

Allows a drag to start only when the base service permits it and the source list allows dragging.

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

The drag context passed to the base service.

Returns:

bool

true when both drag-start conditions are satisfied.

Overrides: RadDragDropService.CanStart(object)

Disposes the layered window used to display the drop-position hint.

C#
protected virtual void DisposeHint()

Updates or disposes the drop-position hint as the pointer moves over a list drop target.

C#
protected override void HandleMouseMove(Point mousePosition)
Parameters:mousePositionPoint

The current pointer position in screen coordinates.

Overrides: RadDragDropService.HandleMouseMove(Point)

Moves the source list's selected items only when the event is unhandled and both source and target lists are unbound.

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

The drop event that identifies the target and whether another handler has processed the drop.

Overrides: RadDragDropService.OnPreviewDragDrop(RadDropEventArgs)

Transfers the source list's selected items to the target list. Items inserted at a specified index are marked active and selected.

C#
protected virtual void OnPreviewDragDropCore(RadListElement targetList, RadListVisualItem targetElement)
Parameters:targetListRadListElement

The list receiving the items.

targetElementRadListVisualItem

The visual item used as the insertion position, or null when no item is hit.

If the insertion index exceeds the target's item count, the item is appended without setting its active or selected state.

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

Overrides: RadDragDropService.OnPreviewDragHint(PreviewDragHintEventArgs)

Sets drop acceptance from the target list's AllowDragDrop setting.

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

The drag-over event containing the hit target and drop-acceptance result.

Overrides: RadDragDropService.OnPreviewDragOver(RadDragOverEventArgs)

Captures the data item represented by the drag context as the item being dragged.

C#
protected override void PerformStart()

Overrides: RadDragDropService.PerformStart()

Releases drop-hint resources and clears the captured dragged item when the drag ends.

C#
protected override void PerformStop()

Overrides: RadDragDropService.PerformStop()

Creates the red, one-pixel drop-position line sized to the target list's visible content area.

C#
protected virtual void PrepareDragHint(RadListElement listElement)
Parameters:listElementRadListElement

The list whose bounds determine the hint width.

Positions the hint at the top or bottom edge of the visual item under the pointer.

C#
protected virtual void UpdateHintPosition(Point mousePosition)
Parameters:mousePositionPoint

The current pointer position in screen coordinates.