Skip to main content

TileControl.EndItemDragging Event

Fires after the dragged tile item is released.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Behavior")]
public event TileItemDragEventHandler EndItemDragging

Event Data

The EndItemDragging event's data class is TileItemDragEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Item Gets or sets a tile item that fired an event which takes the TileItemDragEventArgs object as a parameter.
TargetGroup Gets the TileGroup to which a TileItem being dragged is about to be placed.

Remarks

The EndItemDragging event occurs immediately after a dragged TileItem is released. Handle it to get which item is being dragged and/or the destination and source TileGroups it was dragged to. The example below demonstrates how to obtain both of these groups.

private void tileControl1_EndItemDragging(object sender, DevExpress.XtraEditors.TileItemDragEventArgs e) {
    //source group
    DevExpress.XtraEditors.TileGroup sourceGroup = e.Item.Group;
    //destination group
    DevExpress.XtraEditors.TileGroup destinationGroup = e.TargetGroup;
}

You can also handle the EndItemDragging event to prevent specific drag-and-drop operations by setting the Cancel property to true.

private void tileControl1_EndItemDragging(object sender, DevExpress.XtraEditors.TileItemDragEventArgs e) {
    if (. . .) e.Cancel = true;
}

Note

When the drag operation is started, an item bitmap is created and used for the current drag animation. Therefore, do not modify any appearance settings of a dragged tile (like the AppearanceObject.BackColor property) when handling the EndItemDragging event.

Note

Do not modify tile and group properties within the EndItemDragging event handler. You can only customize the target group’s properties if this group is new and did not exist before the dragging.

The EndItemDragging event is the opposite of the TileControl.StartItemDragging event. Both of these events are fired if the TileControl.AllowDrag property is set to true.

See Also