DxDataGrid<T>.RowUpdatingAsync Event

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public Func<T, IDictionary<string, object>, Task> RowUpdatingAsync { get; set; }

Parameters

Type Description
T

The data item type.

IDictionary<String, Object>

A dictionary that lists column names and new column values.

Remarks

When users click the Edit button in a command column, the grid displays the Edit Form where you can change a row’s data. To post the changes to the Data Grid’s data source or discard these values, handle the RowUpdatingAsync event.

To control the visibility of the Edit command button, use the EditButtonVisible property.

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

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

@code {
    async Task OnRowUpdating(WeatherForecast dataItem, IDictionary<string, object> newValue) {
        await ForecastService.Update(dataItem, newValue);
    }
}
See Also