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:
public class CollectionViewDragDropBehavior
Inheritance: objectCollectionViewDragDropBehavior
Constructors
public CollectionViewDragDropBehavior()
Properties
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.
public bool AllowDrop { get; set; }
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.
public RadCollectionView CollectionView { get; }
Methods
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.
public virtual bool CanDrop(CollectionViewDragDropContext state)
The context information about the current drag and drop operation.
Returns:True if the drop operation can be completed; otherwise, false.
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.
public virtual bool CanStartDrag(CollectionViewDragDropContext state)
The context information about the potential drag operation.
Returns:True if the drag operation can start; otherwise, false.
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.
public virtual void Drop(CollectionViewDragDropContext state)
The context information about the drag and drop operation being completed.
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.
public virtual DropOperation GetDropOperation(CollectionViewDragDropContext state)
The context information about the current drag and drop operation.
Returns:A DropOperation value indicating the type of operation to perform.