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.
Inheritance
Namespace: Telerik.Maui.Controls.CollectionView
Assembly: Telerik.Maui.Controls.dll
Syntax
public class CollectionViewDragDropBehavior : Object
Constructors
CollectionViewDragDropBehavior()
Declaration
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
public bool AllowDrop { get; set; }
Property Value
System.Boolean
|
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
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
public virtual bool CanDrop(CollectionViewDragDropContext state)
Parameters
CollectionViewDragDropContext
state
The context information about the current drag and drop operation. |
Returns
System.Boolean
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
public virtual bool CanStartDrag(CollectionViewDragDropContext state)
Parameters
CollectionViewDragDropContext
state
The context information about the potential drag operation. |
Returns
System.Boolean
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
public virtual void Drop(CollectionViewDragDropContext state)
Parameters
CollectionViewDragDropContext
state
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
public virtual DropOperation GetDropOperation(CollectionViewDragDropContext state)
Parameters
CollectionViewDragDropContext
state
The context information about the current drag and drop operation. |
Returns
DropOperation
A DropOperation value indicating the type of operation to perform. |