Skip to main content

CellEditContext.EditedValues Property

Returns a collection of changed cell values.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public Dictionary<string, object> EditedValues { get; }

Property Value

Type Description
Dictionary<String, Object>

A collection of cell values.

Remarks

The EditedValues returns a collection of changed cell values when you add or edit a row. This collection is empty when you start editing or inserting a new row. When a user changes a cell value, call the OnChanged method to inform the grid that a custom editor’s value is changed and save the updated cell value to the EditedValue collection.

The EditedValues 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>

@code {
    IEnumerable<Product> DataSource;
    IEnumerable<ProductCategory> NestedDataSource;

    protected override async Task OnInitializedAsync()
    {
        DataSource = await ProductService.LoadAsync();
        NestedDataSource = await ProductCategoriesProvider.GetProductCategoriesAsync();
    }
}

Run Demo: Data Grid - Templates

See Also