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
| Parameter | Description | Type | Default |
|---|---|---|---|
ApplyDropClassesOnDragStarted |
When true, DropAllowedClass or DropNotAllowedClass drop classes are applied as soon as a transaction has started. |
bool | false |
ChildContent |
Specifies the content to be rendered inside this DropContainer. |
RenderFragment | null |
DisabledClass |
Classname that is applied to the dropzone if the result of ItemDisabled is false. |
string | |
DraggingClass |
Classname that is applied to the dropzone when the drag operation has started. |
string | |
DropAllowedClass |
Classname that is applied if dropping to the current zone is allowed. |
string | |
DropNotAllowedClass |
Classname that is applied if dropping to the current zone is not allowed. |
string | |
ItemDraggingClass |
Classname that is applied to the drag item when it is being dragged. |
string | |
Items |
Items that are used for the drag&drop withing the container. |
IEnumerable<TItem> | null |
ItemTemplate |
The render method that is used to render the items withing the dropzone. |
RenderFragment<TItem> | null |
DropZone
| Parameter | Description | Type | Default |
|---|---|---|---|
AllowReorder |
If true, the reordering of the items will be enabled. |
bool | false |
ApplyDropClassesOnDragStarted |
When true, DropAllowedClass or DropNotAllowedClass drop classes are applied as soon as a transaction has started. |
bool? | null |
ChildContent |
Specifies the content to be rendered inside this DropZone. |
RenderFragment | null |
DisabledClass |
Classname that is applied to the dropzone if the result of ItemDisabled is false. |
string | |
DraggingClass |
Classname that is applied to the dropzone when the drag operation has started. |
string | |
DropAllowedClass |
Classname that is applied if dropping to the current zone is allowed. |
string | |
DropNotAllowedClass |
Classname that is applied if dropping to the current zone is not allowed. |
string | |
ItemDraggingClass |
Classname that is applied to the drag item when it is being dragged. |
string | |
ItemTemplate |
The render method that is used to render the items withing the dropzone. |
RenderFragment<TItem> | null |
Name |
Specifies the unique name of the dropzone. |
string | |
OnlyZone |
If true, will only act as a dropable zone and not render any items. |
bool | false |
Events
DropContainer
| Event | Description | Type |
|---|---|---|
DropAllowed |
Determines if the item is allowed to be dropped to the specified zone. |
Func<TItem, string, bool> |
ItemDisabled |
Determines if the item is disabled for dragging and dropping. |
Func<TItem, bool> |
ItemDropped |
Callback that indicates that an item has been dropped on a drop zone. Should be used to update the "status" of the data item. |
EventCallback<DraggableDroppedEventArgs<TItem>> |
ItemsFilter |
The method used to determine if the item belongs to the dropzone. |
Func<TItem, string, bool> |
DropZone
| Event | Description | Type |
|---|---|---|
DropAllowed |
Determines if the item is allowed to be dropped to this zone. |
Func<TItem, bool> |
ItemDisabled |
Determines if the item is disabled for dragging and dropping. |
Func<TItem, bool> |
ItemsFilter |
The method used to determine if the item belongs to the dropzone. |
Func<TItem, bool> |
Reordered |
The callback that is raised when the order of items changed. Only if AllowReorder is enabled. |
Func<DropZoneOrder<TItem>, Task> |
Methods
DropContainer
| Method | Description | Return | Parameters |
|---|---|---|---|
CancelTransaction |
Cancels the drag & drop transaction. | Task | |
CommitTransaction |
Commits the drag & drop transaction. | Task | string dropZoneName, bool reorderIsAllowed |
GetTransactionIndex |
Gets the current transaction index. | int | |
GetTransactionItem |
Gets the item that is currently in the transaction. | TItem | |
IsOrigin |
Indicates if the supplied name and transaction index are in the current transaction. | bool | int index, string zoneName |
IsTransactionOriginatedFromInside |
Gets the name of the zone where the transaction has started. | bool | string zoneName |
Refresh |
Request the refresh of the drag container. | void | |
StartTransaction |
Starts the new drag & drop transaction for the specified item and dropzone. | void | TItem item, string sourceZoneName, int draggableIndex, Func<Task> commited, Func<Task> canceled |
UpdateTransactionIndex |
Updates the draggable index for the current transaction. | void | int index |