Class
CollectionViewDragDropBehavior

Defines the behavior and logic for drag and drop operations within a RadCollectionView control. This class provides customization points for controlling when drag operations can start, when drops are allowed, and how the drop operation is completed.

Definition

Namespace:Telerik.Maui.Controls.CollectionView

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class CollectionViewDragDropBehavior

Inheritance: objectCollectionViewDragDropBehavior

Constructors

CollectionViewDragDropBehavior()

Declaration

cs-api-definition
public CollectionViewDragDropBehavior()

Properties

AllowDrop

Gets or sets a value indicating whether drop operations are allowed on this collection view. When set to false, the collection view will not accept dropped items from drag operations. Default is true.

Declaration

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

Property Value

bool

CollectionView

Gets the RadCollectionView control instance that this behavior is associated with. Returns null if the collection view has been garbage collected or is not set.

Declaration

cs-api-definition
public RadCollectionView CollectionView { get; }

Property Value

RadCollectionView

Methods

CanDrop(CollectionViewDragDropContext)

Determines whether the current drop operation can be completed based on the drag and drop context. Override this method to provide custom validation logic for when drop operations are allowed.

Declaration

cs-api-definition
public virtual bool CanDrop(CollectionViewDragDropContext state)

Parameters

state

CollectionViewDragDropContext

The context information about the current drag and drop operation.

Returns

bool

True if the drop operation can be completed; otherwise, false.

CanStartDrag(CollectionViewDragDropContext)

Determines whether a drag operation can be initiated with the current context. Override this method to provide custom validation logic for when drag operations are allowed to start.

Declaration

cs-api-definition
public virtual bool CanStartDrag(CollectionViewDragDropContext state)

Parameters

state

CollectionViewDragDropContext

The context information about the potential drag operation.

Returns

bool

True if the drag operation can start; otherwise, false.

Drop(CollectionViewDragDropContext)

Executes the drop operation, performing the actual data manipulation to complete the drag and drop. This method is called only when the item is dropped on a valid drop target. Override this method to provide custom drop logic.

Declaration

cs-api-definition
public virtual void Drop(CollectionViewDragDropContext state)

Parameters

state

CollectionViewDragDropContext

The context information about the drag and drop operation being completed.

GetDropOperation(CollectionViewDragDropContext)

Determines the type of drop operation to perform based on the current drag and drop context. Override this method to provide custom logic for determining whether items should be moved, copied, or if the drop should be refused.

Declaration

cs-api-definition
public virtual DropOperation GetDropOperation(CollectionViewDragDropContext state)

Parameters

state

CollectionViewDragDropContext

The context information about the current drag and drop operation.

Returns

DropOperation

A DropOperation value indicating the type of operation to perform.