Skip to main content
A newer version of this page is available. .

CellEditContext.OnChanged(Object) Method

A delegate method that handles changes in a custom editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public virtual void OnChanged(
    object value
)

Parameters

Name Type Description
value Object

Cell values.

Remarks

When you use an edit template, the grid does not know what you have changed in editors inside this template. Call the OnChanged method when you change a cell value in a custom editor to inform the grid about the change and save a new cell value to the EditedValues collection. Then, this collection is passed to the RowUpdating and RowInserting events.

<DxDataGrid Data="@DataSource"
    RowUpdating="@((updatingDataItem, newValues) => OnRowUpdating(updatingDataItem, newValues))"
    RowInserting="@((newValues) => OnRowInserting(newValues))">
    ...
    <DxDataGridColumn Field="@nameof(Product.ProductCategoryId)" Caption="Category">
        <EditTemplate>
            <DxDataGrid Data="@NestedDataSource"
                SelectedDataRowChanged="@(newCellValue => cellEditContext.OnChanged(newCellValue.ProductSubcategoryID))">
                ...
            </DxDataGrid>
        </EditTemplate>
    </DxDataGridColumn>
</DxDataGrid>

Online Demo

Data Grid - Templates

See Also