Skip to main content

GridCustomizeGroupValueDisplayTextEventArgs Class

Contains data for the CustomizeGroupValueDisplayText event.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.2.dll

Declaration

public class GridCustomizeGroupValueDisplayTextEventArgs

Remarks

Use GridCustomizeGroupValueDisplayTextEventArgs (Value , DisplayText, and so on) to specify the group value’s display text and access other grid data.

The example below illustrates how to display a dollar sign before the group value:

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="GridDataSource"
        ShowGroupPanel="true"
        CustomizeGroupValueDisplayText="Grid_CustomizeGroupValueDisplayText">
    <Columns>
        <DxGridDataColumn FieldName="ProductId" Caption="Product ID" DisplayFormat="d" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="Quantity" />
        <DxGridDataColumn FieldName="Discount" DisplayFormat="p0" />
    </Columns>
</DxGrid>

@code {
    object GridDataSource { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        GridDataSource = Northwind.OrderDetails
            .Include(i => i.Order)
            .Include(i => i.Product)
            .ToList();
    }

    void Grid_CustomizeGroupValueDisplayText(GridCustomizeGroupValueDisplayTextEventArgs e) {
        if (e.FieldName == "UnitPrice")
            e.DisplayText = string.Format(" ${0}", e.Value);
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

DevExpress Blazor Grid - Customize Group Value

Inheritance

Object
GridCustomizeGroupValueDisplayTextEventArgs
See Also