DxDataGrid<T>.RowRemovingAsync Event

Occurs when a user removes a data row and allows you to await handler execution without blocking the Data Grid.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll


public Func<T, Task> RowRemovingAsync { get; set; }


Type Description

The data item type.


Handle the RowRemovingAsync event to remove the data item from the Data Grid’s data source or discard changes.

To control the visibility of the Delete command button, use the DeleteButtonVisible property.

@inject MyApp.Data.WeatherForecastService ForecastService
@using MyApp.Data

<DxDataGrid DataAsync="@ForecastService.GetForecastAsync" 
    <DxDataGridCommandColumn />
    <DxDataGridDateEditColumn Field=@nameof(WeatherForecast.Date) />
    <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.TemperatureC)" 
                              Caption="@("Temp. (\x2103)")" />
    <DxDataGridColumn Field=@nameof(WeatherForecast.TemperatureF) Caption="Temp. (F)" />

@code {
    async Task OnRowRemoving(WeatherForecast dataItem) {
        await ForecastService.Remove(dataItem);

If you bind the data grid to a data source that does not implement the INotifyCollectionChanged interface, you should reload data and redraw the grid after a row is deleted. To do this, use the Refresh method in the OnRowRemoving handler.

See Also