Back to Devexpress

DXDefaultEventArgs.Default() Method

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

latest3.8 KB
Original Source

DXDefaultEventArgs.Default() Method

Invokes the default action the attached control performs on the current drag-and-drop operation stage.

Namespace : DevExpress.Utils.DragDrop

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

csharp
public void Default()
vb
Public Sub Default

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 snippets (auto-collected from DevExpress Examples) contain references to the Default() method.

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#L111

csharp
private void OnDragOver(object sender, DevExpress.Utils.DragDrop.DragOverEventArgs e) {
    e.Default();
    e.Action = DragDropActions.Copy;

winforms-grid-drag-and-drop-selected-rows/CS/Form1.cs#L46

csharp
private void ListBoxBehavior_DragOver(object sender, DragOverEventArgs e) {
    e.Default();
    Cursor.Current = Cursors.Default;

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

vb
Private Overloads Sub OnDragOver(ByVal sender As Object, ByVal e As DragOverEventArgs)
    e.Default()
    e.Action = DragDropActions.Copy

winforms-grid-drag-and-drop-selected-rows/VB/Form1.vb#L55

vb
Private Sub ListBoxBehavior_DragOver(ByVal sender As Object, ByVal e As DragOverEventArgs)
    e.Default()
    Cursor.Current = Cursors.Default

See Also

DXDefaultEventArgs Class

DXDefaultEventArgs Members

DevExpress.Utils.DragDrop Namespace