Skip to main content
All docs
V26.1
  • DragDropBehaviorBase<TDragDropBehaviorSource, TDragDropBehaviorProperties>.DragLeave Event

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

    Namespace: DevExpress.Utils.DragDrop

    Assembly: DevExpress.Utils.v26.1.dll

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

    Declaration

    [DXCategory("DragDrop")]
    public event DragLeaveEventHandler DragLeave

    Event Data

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

    Property Description
    Cursor Gets or sets the mouse pointer.
    Handled Gets 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:

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

    Remarks

    If you attached the Drag-and-Drop Behavior to a control in the designer, use the DragDropEvents component to subscribe to the drag-and-drop events.

    Example

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

    //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;
    }
    

    Note

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

    See Also