Skip to main content

CellEditContext.CellValue Property

Returns the current cell value.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public virtual object CellValue { get; }

Property Value

Type Description
Object

A cell value.

Remarks

The CellValue property specifies 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();
    }
}

Run Demo: Data Grid - Templates

See Also