Class DropEventArgs<T>
Provides event data for the OnDrop and Dropped events in the SfListBox<TValue, TItem> component.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class DropEventArgs<T> : Object
Type Parameters
Name | Description |
---|---|
T | The type representing the dropped items (typically |
Remarks
This argument provides access to event details during listbox item drop, including placement, involved items, and positional data.
Examples
private void OnItemDrop(DropEventArgs<Employee> args)
{
var target = args.TargetId;
var left = args.Left;
}
Constructors
DropEventArgs()
Declaration
public DropEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the drop event should be canceled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Set to true
to prevent completing the drag-and-drop action.
Examples
args.Cancel = true;
DropIndex
Gets the index of the dropped target within the SfListBox<TValue, TItem>.
Declaration
public int DropIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An |
Remarks
Indicates where the dropped item(s) will be inserted in the destination.
Examples
int targetIdx = args.DropIndex;
Items
Gets or sets the items involved in the drop event.
Declaration
public IEnumerable<T> Items { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | An System.Collections.Generic.IEnumerable<> containing the items being dropped. The default value is |
Remarks
Use to process or modify dropped items in your application logic.
Examples
var droppedItems = args.Items;
Left
Gets the X coordinate (client left) value of the target element during drop.
Declaration
public double Left { get; }
Property Value
Type | Description |
---|---|
System.Double | A |
Remarks
Examples
double x = args.Left;
TargetId
Gets the ID of the element on which the user releases the mouse or finger to complete a drag-and-drop action.
Declaration
public string TargetId { get; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
Use for advanced drag-and-drop scenarios involving targets outside the ListBox.
Examples
var id = args.TargetId;
Top
Gets the Y coordinate (client top) value of the target element during drop.
Declaration
public double Top { get; }
Property Value
Type | Description |
---|---|
System.Double | A |
Remarks
Examples
double y = args.Top;