DxGridDataColumn.UnboundExpression Property

Specifies an expression to evaluate values for the unbound column.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public string UnboundExpression { get; set; }

Property Value

Type Description
String

The expression.

Remarks

The following example illustrates how to specify an expression (UnboundExpression) to evaluate the total price for each product and display this value in the “Total Price” unbound column:

<DxGrid Data="GridDataSource">
    <Columns>
        <DxGridDataColumn FieldName="Product.ProductName" Caption="Product Name" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c"  />
        <DxGridDataColumn FieldName="Quantity" DisplayFormat="d"  />
        <DxGridDataColumn FieldName="Discount" DisplayFormat="p0" />
        <DxGridDataColumn FieldName="TotalPrice"
                      DisplayFormat="c"
                      UnboundType="GridUnboundColumnType.Decimal"
                      UnboundExpression="UnitPrice * Quantity * (1 - Discount)" />
    </Columns>
</DxGrid>

@code {

    object GridDataSource { get; set; }

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

DevExpress Blazor Grid - Unbound Columns

Implements

See Also