Class DragEventArgs<T>
Provides event data for the DragStart event of the SfListBox<TValue, TItem> component.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class DragEventArgs<T> : Object
Type Parameters
Name | Description |
---|---|
T | The type of the event data (usually |
Remarks
This event is triggered when a drag operation is initiated from a ListBox item.
Examples
private void OnDragStart(DragEventArgs<Employee> args)
{
if (args.Items != null && args.Items.Count() > 1) {
// Custom logic for multi-item drag
}
}
Constructors
DragEventArgs()
Declaration
public DragEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the drag event should be canceled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Set this property to true
within your event handler to prevent the default drag operation.
Examples
args.Cancel = true; // Cancels drag
DragIndex
Gets the index of the dragged item in the source SfListBox<TValue, TItem>.
Declaration
public int DragIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An |
Remarks
If multiple items are selected for dragging, DragIndex
is the index of the last item.
Examples
int index = args.DragIndex;
Items
Gets or sets the items being dragged during the drag operation.
Declaration
public IEnumerable<T> Items { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | An System.Collections.Generic.IEnumerable<> representing the dragged items. The default value is |
Remarks
Use this property to manipulate or examine the items involved in the drag event.
Examples
var draggedItems = args.Items;