skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class DragDropHelper<TBehavior, TState>

Binds the DragDropManager events with a DragDropBehavior.

Inheritance
System.Object
DragDropHelper<TBehavior, TState>
RadListBoxDragDropHelper
TaskBoardColumnDragDropHelper
GridViewDragDropHelper
ListBoxDragDropHelper
Namespace: Telerik.Windows.DragDrop.Behaviors
Assembly: Telerik.Windows.Controls.dll

Syntax

public abstract class DragDropHelper<TBehavior, TState> : Object where TBehavior : DragDropBehavior<TState> where TState : DragDropState, new()
Type Parameters
TBehavior

TState

Constructors

DragDropHelper()

Declaration
protected DragDropHelper()

Properties

DataConverter

Gets or sets the IDataObjectProvider instance that will be used in the drag-drop operations.

Declaration
public DataConverter DataConverter { get; set; }
Property Value
DataConverter

DragDropBehavior

Gets or sets the DragDropBehavior that will be used in the drag-drop operations.

Declaration
public TBehavior DragDropBehavior { get; set; }
Property Value
TBehavior

DragVisualProvider

Gets or sets the DragVisualProvider that will be used in the drag-drop operations.

Declaration
public IDragVisualProvider DragVisualProvider { get; set; }
Property Value
IDragVisualProvider

Methods

CreateDragVisualProviderState(Point, FrameworkElement, TState)

Creates and initializes a DragVisualProviderState object.

Declaration
protected virtual DragVisualProviderState CreateDragVisualProviderState(Point relativeStartPoint, FrameworkElement control, TState state)
Parameters
System.Windows.Point relativeStartPoint

System.Windows.FrameworkElement control

TState state

Returns
DragVisualProviderState

CreateStateForDrop(FrameworkElement, FrameworkElement, Object, Type)

Creates and initializes a DragDropState from the provided DragEventArgs.

Declaration
protected virtual TState CreateStateForDrop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters
System.Windows.FrameworkElement dropTarget

System.Windows.FrameworkElement dropItemsControl

System.Object data

System.Type itemType

Returns
TState

DragDropCompleted(FrameworkElement, Object, Type, Boolean)

When overridden in a derived class allows calling custom code on the DragDropCompleted event.

Declaration
protected virtual void DragDropCompleted(FrameworkElement dropItemsControl, object data, Type itemType, bool wasCanceled)
Parameters
System.Windows.FrameworkElement dropItemsControl

System.Object data

System.Type itemType

System.Boolean wasCanceled

DragLeave(FrameworkElement, FrameworkElement, Object, Type)

When overridden in a derived class allows calling custom code on the MouseLeave event.

Declaration
protected virtual void DragLeave(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters
System.Windows.FrameworkElement dropTarget

The object that is being dropped.

System.Windows.FrameworkElement dropItemsControl

The destination ItemsControl.

System.Object data

The drag and drop data.

System.Type itemType

The data type of the dragged item.

DragOver(FrameworkElement, FrameworkElement, Object, Type)

When overridden in a derived class allows calling custom code on the DragOver event.

Declaration
protected virtual DragDropEffects DragOver(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters
System.Windows.FrameworkElement dropTarget

System.Windows.FrameworkElement dropItemsControl

System.Object data

System.Type itemType

Returns
System.Windows.DragDropEffects

Drop(FrameworkElement, FrameworkElement, Object, Type)

When overridden in a derived class allows custom code in the Drop event.

Declaration
protected virtual void Drop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters
System.Windows.FrameworkElement dropTarget

System.Windows.FrameworkElement dropItemsControl

System.Object data

System.Type itemType

FindDraggedItem(FrameworkElement)

Finds the control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return the ListBoxItem that is going to be dragged.

Declaration
protected abstract FrameworkElement FindDraggedItem(FrameworkElement element)
Parameters
System.Windows.FrameworkElement element

The element that raised the DragInitialize event.

Returns
System.Windows.FrameworkElement

FindDragSource(FrameworkElement)

Finds the control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return a ListBox.

Declaration
protected abstract FrameworkElement FindDragSource(FrameworkElement element)
Parameters
System.Windows.FrameworkElement element

The element that raised the DragInitialize event.

Returns
System.Windows.FrameworkElement

FindDropItemsControl(FrameworkElement, Object)

Finds the target control that should accept the dragged items. In case of a ListBox drag-drop implementation, this method should return a ListBox.

Declaration
protected abstract FrameworkElement FindDropItemsControl(FrameworkElement element, object data)
Parameters
System.Windows.FrameworkElement element

The element that raised the Drop event.

System.Object data

The DataObject for the current drag operation.

Returns
System.Windows.FrameworkElement

FindDropTarget(FrameworkElement)

Finds an item from the target control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return a ListBoxItem.

Declaration
protected abstract FrameworkElement FindDropTarget(FrameworkElement element)
Parameters
System.Windows.FrameworkElement element

The element that raised the Drop event.

Returns
System.Windows.FrameworkElement

GetContainerFromItem(FrameworkElement, Object)

Returns the container for the specified item. When overridden in a derived class allows usage of custom ItemContainerGenerators.

Declaration
protected virtual DependencyObject GetContainerFromItem(FrameworkElement control, object item)
Parameters
System.Windows.FrameworkElement control

System.Object item

Returns
System.Windows.DependencyObject

GetDraggedItems(FrameworkElement)

When overridden in a derived class this method returns the items that should be dragged.

Declaration
protected abstract IEnumerable<object> GetDraggedItems(FrameworkElement draggedItem)
Parameters
System.Windows.FrameworkElement draggedItem

The source control of the drag operation.

Returns
System.Collections.Generic.IEnumerable<System.Object>

The items that should be dragged.

GetInferredItemType(IEnumerable)

Returns the type of the items in the provided collection.

Declaration
protected static Type GetInferredItemType(IEnumerable itemsSource)
Parameters
System.Collections.IEnumerable itemsSource

Returns
System.Type

GetItemsFromDataObject(Object, Type)

Retrieves items from the specified data object only of the specified type.

Declaration
protected IEnumerable GetItemsFromDataObject(object data, Type itemType)
Parameters
System.Object data

System.Type itemType

Returns
System.Collections.IEnumerable

GetItemsOfType(IEnumerable, Type)

Returns IEnumerable containing only items from the provided Type.

Declaration
protected static IEnumerable GetItemsOfType(IEnumerable enumerable, Type itemType)
Parameters
System.Collections.IEnumerable enumerable

System.Type itemType

Returns
System.Collections.IEnumerable

GetItemsSource(FrameworkElement)

Returns a list containing the items of the specified control.

Declaration
protected virtual IList GetItemsSource(FrameworkElement element)
Parameters
System.Windows.FrameworkElement element

Returns
System.Collections.IList

GetItemType(FrameworkElement)

Returns the Type of the items in the provided control.

Declaration
protected Type GetItemType(FrameworkElement control)
Parameters
System.Windows.FrameworkElement control

Returns
System.Type

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.