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

CellEditContext.CellValue Property

Returns the current cell value.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public object CellValue { get; }

Property Value

Type Description
Object

A cell value.

Remarks

The CellValue property provides the current cell value.

<DxDataGrid Data="@DataSource">
    ...
    <DxDataGridColumn Field="@nameof(Product.ProductCategoryId)" >
        <EditTemplate>
            @{ 
                var cellEditContext = (CellEditContext)context;
                int currentCellValue = (int)cellEditContext.CellValue;
                var nestedItem = NestedDataSource.Where(x => x.ProductSubcategoryID == currentCellValue).FirstOrDefault();
            }
        </EditTemplate>
    </DxDataGridColumn>

</DxDataGrid>

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

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

Online Demo

Data Grid - Templates

See Also