Back to Devexpress

DXDefaultEventArgs.Handled Property

windowsforms-devexpress-dot-utils-dot-dragdrop-dot-dxdefaulteventargs.md

latest3.1 KB
Original Source

DXDefaultEventArgs.Handled Property

Gets or sets whether the event was handled and allows you to suppress the default action.

Namespace : DevExpress.Utils.DragDrop

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

csharp
public bool Handled { get; set; }
vb
Public Property Handled As Boolean

Property Value

TypeDescription
Boolean

true to suppress the default action; otherwise, false.

|

Remarks

Controls that support the Drag-and-Drop Behavior have a default action for each stage of a drag-and-drop operation. For instance, when data elements are dragged over a control, the control calculates the insert indicator’s bounds. When data elements are dropped, the control moves or copies data elements. The following arguments allow you to invoke or suppress the default action:

  • The Handled property - gets or sets whether you handled the event. If the event is handled, the control does not perform the default action.

  • The Default() method - invokes the default action. If you call this method, the Handled property is automatically set to true.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Handled property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

drag-drop-grid-rows-to-treelist/CS/DragAndDropRows/Form1.cs#L113

csharp
e.Action = DragDropActions.Copy;
e.Handled = true;
e.Cursor = Cursors.Default;

drag-drop-grid-rows-to-treelist/VB/DragAndDropRows/Form1.vb#L108

vb
e.Action = DragDropActions.Copy
e.Handled = True
e.Cursor = Cursors.Default

See Also

DXDefaultEventArgs Class

DXDefaultEventArgs Members

DevExpress.Utils.DragDrop Namespace