Skip to main content

GridCustomizeCellDisplayTextEventArgs Class

Contains data for the CustomizeCellDisplayText event.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v25.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public class GridCustomizeCellDisplayTextEventArgs :
    GridCustomizeCellDisplayTextEventArgsBase

Remarks

Use GridCustomizeCellDisplayTextEventArgs (Value, FieldName, and so on) to specify the display format and access other grid data.

The following code snippet add the dollar sign to the Value column’s cell display text:

<DxGrid Data="Data"
        CustomizeCellDisplayText="Grid_CustomizeCellDisplayText">
    <Columns>
        <DxGridDataColumn FieldName="Product" />
        <DxGridDataColumn FieldName="Value" />
    </Columns>
</DxGrid>

@code {
    private List<object> Data = [];

    protected override void OnInitialized() {
        List<string> Products = new List<string> { "Soda", "Cookies", "Milk", "Candy", "Chicken", "Eggs", "Cheese", "Cereal", "Vegetables", "Berries" };
        for (int i = 1; i <= 10; i++) {
            int Value = i * 100;
            Data.Add(new() { Product = Products[i - 1], Value = Value });
        }
    }

    void Grid_CustomizeCellDisplayText(GridCustomizeCellDisplayTextEventArgs e) {
        if (e.FieldName == "Value") {
            e.DisplayText = $" ${e.Value}" ;
        }
    }
}

DevExpress Blazor Grid - Customize Cell Display Text

Inheritance

Object
DevExpress.Blazor.Grid.Internal.GridEventArgsBase
DevExpress.Blazor.Grid.Internal.GridCustomizeCellDisplayTextEventArgsBase
GridCustomizeCellDisplayTextEventArgs
See Also