Skip to main content

DataGridView.CompleteRowDragDrop Event

Occurs after the drag-and-drop operation is completed.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

NuGet Package: DevExpress.XamarinForms.Grid

#Declaration

C#
public event EventHandler<CompleteRowDragDropEventArgs> CompleteRowDragDrop

#Event Data

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

Property Description
Item Gets a data source item that corresponds to the dragged and dropped row.
RowHandle Gets the grid’s row handle. Inherited from RowEventArgs.

#Remarks

You can define an action that is executed when the drag-and-drop operation is completed.

  1. Subscribe to the CompleteRowDragDrop event.

    <dxg:DataGridView AllowDragDropRows="True" 
                      CompleteRowDragDrop="grid_CompleteRowDragDrop"/>
    
  2. In the event handler, use the RowHandle property to get the dropped row handle. To access a data source item (EmployeeTask with the DueDate property) that corresponds to the dropped row, use the Item property.

    The following example shows how to raise an alert message when a user drags and drops an item:

    using DevExpress.XamarinForms.DataGrid;
    
    // ...
    private void grid_CompleteRowDragDrop(object sender, CompleteRowDragDropEventArgs e) {
        DisplayAlert("Reminder", "The row with due date of " 
        + ((EmployeeTask)e.Item).DueDate + " has changed its position to " 
        + (e.RowHandle + 1) + ". Don't miss the deadline!", "OK");
    }
    
See Also