Back to Devexpress

DragDropEvents.DragLeave Event

windowsforms-devexpress-dot-utils-dot-dragdrop-dot-dragdropevents-61e00d59.md

latest2.9 KB
Original Source

DragDropEvents.DragLeave Event

Occurs when a data element is dragged out of the control’s bounds.

Namespace : DevExpress.Utils.DragDrop

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[DXCategory("DragDrop")]
public event DragLeaveEventHandler DragLeave
vb
<DXCategory("DragDrop")>
Public Event DragLeave As DragLeaveEventHandler

Event Data

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

PropertyDescription
CursorGets or sets the mouse pointer.
HandledGets or sets whether the event was handled and allows you to suppress the default action. Inherited from DXDefaultEventArgs.

The event data class exposes the following methods:

MethodDescription
Default()Invokes the default action the attached control performs on the current drag-and-drop operation stage. Inherited from DXDefaultEventArgs.

Example

The example below shows how to give feedback to users when the mouse pointer leaves the control.

csharp
//The operation is not allowed when the cursor leaves the grid.
private void dragDropEvents1_DragLeave(object sender, DragLeaveEventArgs e) {
    e.Default();
    e.Cursor = Cursors.No;
}
vb
'The operation is not allowed when the cursor leaves the grid.
Private Sub dragDropEvents1_DragLeave(ByVal sender As Object, ByVal e As DevExpress.Utils.DragDrop.DragLeaveEventArgs) _
    Handles dragDropEvents1.DragLeave
    e.Default()
    e.Cursor = Cursors.No
End Sub

Note

Run the XtraTreeList or XtraGrid demo and click Open Solution for more examples.

See Also

DragDropEvents Class

DragDropEvents Members

DevExpress.Utils.DragDrop Namespace