Skip to main content

DxDataGrid<T>.CancelRowEdit() Method

Asynchronously closes the edit form and does not save changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll


public Task CancelRowEdit()


Type Description

An asynchronous operation that closes the edit form.



The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

Use the CancelRowEdit method to close the edit form and discard changes that users made. The RowEditCancel and RowEditCancelAsync events are fired when you call this method.


This method does not discard changes that were accepted and passed to the data item.

The following code snippet demonstrates how to implement a custom Cancel button outside the Data Grid:

<button id="cancelButton" @onclick="@Cancel">Cancel</button>

<DxDataGrid DataAsync="@ForecastService.GetForecastAsync"
            @ref="MyGrid" ...>
        <DxDataGridColumn Field=@nameof(WeatherForecast.TemperatureC) Caption="Temp. (C)"></DxDataGridColumn>

@functions {
    DevExpress.Blazor.DxDataGrid<WeatherForecast> MyGrid;

    async Task Cancel() {
        await MyGrid.CancelRowEdit();
See Also