DxGridDataColumn.UnboundExpression Property
Specifies an expression to evaluate values for the unbound column.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v21.1.dll
NuGet Package: DevExpress.Blazor
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();
}
@* ... *@
}
Note
The Grid does not support unbound columns when you use a GridDevExtremeDataSource.
Implements
See Also