Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataGridView.CompleteRowDragDrop Event

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

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

#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.Maui.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