Blazorise Drag & Drop API

Explore the Blazorise Drag & Drop API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the Drag & Drop documentation.

API

Parameters

DropContainer

ParameterDefaultType
ApplyDropClassesOnDragStartedfalsebool

When true, DropAllowedClass or DropNotAllowedClass drop classes are applied as soon as a transaction has started.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this DropContainer.
DisabledClass—string

Classname that is applied to the dropzone if the result of ItemDisabled is false.
DraggingClass—string

Classname that is applied to the dropzone when the drag operation has started.
DropAllowedClass—string

Classname that is applied if dropping to the current zone is allowed.
DropNotAllowedClass—string

Classname that is applied if dropping to the current zone is not allowed.
ItemDraggingClass—string

Classname that is applied to the drag item when it is being dragged.
ItemsnullIEnumerable<TItem>

Items that are used for the drag&drop withing the container.
ItemTemplatenullRenderFragment<TItem>

The render method that is used to render the items withing the dropzone.
PlaceholderTemplatenullRenderFragment<TItem>

The template used to render the placeholder for the item being reordered. The template receives the item currently being dragged.

DropZone

ParameterDefaultType
AllowReorderfalsebool

If true, the reordering of the items will be enabled.
Animatedfalsebool

If true, animates item movement during reordering. Requires AllowReorder. Respects the user's reduced motion preference.
AnimationDuration200int

Gets or sets the reorder animation duration, in milliseconds. Values less than or equal to zero disable the animation.
ApplyDropClassesOnDragStartedfalsebool?

When true, DropAllowedClass or DropNotAllowedClass drop classes are applied as soon as a transaction has started.
When omitted, inherits the parent container's setting.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this DropZone.
DisabledClassDropContainer.DisabledClassstring

Classname that is applied to the dropzone if the result of ItemDisabled is false.
DraggingClassDropContainer.DraggingClassstring

Classname that is applied to the dropzone when the drag operation has started.
DropAllowedClassb-drop-zone-drop-allowedstring

Classname that is applied if dropping to the current zone is allowed.
When omitted, inherits the parent container's class before using the built-in class.
DropNotAllowedClassb-drop-zone-drop-not-allowedstring

Classname that is applied if dropping to the current zone is not allowed.
When omitted, inherits the parent container's class before using the built-in class.
ItemDraggingClassDropContainer.ItemDraggingClassstring

Classname that is applied to the drag item when it is being dragged.
ItemTemplatenullRenderFragment<TItem>

The render method that is used to render the items withing the dropzone.
Name—string

Specifies the unique name of the dropzone.
OnlyZonefalsebool

If true, will only act as a dropable zone and not render any items.
PlaceholderTemplateDropContainer.PlaceholderTemplateRenderFragment<TItem>

The template used to render the placeholder for the item being reordered. The template receives the item currently being dragged and overrides the template defined by the parent container.
ShowPlaceholdertruebool?

Controls the visibility of the reorder placeholder's outline and content without removing its reserved space. When null, the placeholder is visible for non-animated reordering or when a placeholder template is supplied.
When omitted, shows the placeholder if reorder animation is disabled or a placeholder template is available.

Events

DropContainer

EventType
DropAllowedFunc<TItem, string, bool>

Determines if the item is allowed to be dropped to the specified zone.
ItemDisabledFunc<TItem, bool>

Determines if the item is disabled for dragging and dropping.
ItemDroppedEventCallback<DraggableDroppedEventArgs<TItem>>

Callback that indicates that an item has been dropped on a drop zone. Should be used to update the "status" of the data item.
ItemsFilterFunc<TItem, string, bool>

The method used to determine if the item belongs to the dropzone.

DropZone

EventType
DropAllowedFunc<TItem, bool>

Determines if the item is allowed to be dropped to this zone.
ItemDisabledFunc<TItem, bool>

Determines if the item is disabled for dragging and dropping.
ItemsFilterFunc<TItem, bool>

The method used to determine if the item belongs to the dropzone.
ReorderedFunc<DropZoneOrder<TItem>, Task>

The callback that is raised when the order of items changed. Only if AllowReorder is enabled.

Methods

DropContainer

MethodReturnParameters
CancelTransactionTask—

Cancels the drag & drop transaction.
CommitTransactionTaskstring dropZoneName, bool reorderIsAllowed

Commits the drag & drop transaction.
GetTransactionIndexint—

Gets the current transaction index.
GetTransactionItemTItem—

Gets the item that is currently in the transaction.
IsOriginboolint index, string zoneName

Indicates if the supplied name and transaction index are in the current transaction.
IsTransactionOriginatedFromInsideboolstring zoneName

Gets the name of the zone where the transaction has started.
Refreshvoid—

Request the refresh of the drag container.
StartTransactionvoidTItem item, string sourceZoneName, int draggableIndex, Func<Task> commited, Func<Task> canceled

Starts the new drag & drop transaction for the specified item and dropzone.
UpdateTransactionIndexvoidint index

Updates the draggable index for the current transaction.