DxDataGridSummaryItem.ShowInColumn Property

Specifies a column under which the summary value should be displayed.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

Declaration

[Parameter]
[DefaultValue("")]
public string ShowInColumn { get; set; }

Property Value

Type Default Description
String

String.Empty

The column name.

Remarks

To calculate a total summary, add a DxDataGridSummaryItem object to the TotalSummary collection. Use the item's SummaryType property to specify an aggregate function.

The Avg, Min, Max, and Sum functions require that you set the Field property to a data field whose values the summary item processes. The summary value is displayed under the column bound to the specified data field. To show the summary value under another column, specify the ShowInColumn property.

If you select the Count function, you can use either the Field or ShowInColumn property to specify which column displays the number of rows.

NOTE

The ShowInColumn property is not in effect if the summary item is added to the GroupSummary collection.

<DxDataGrid Data="@Orders">
    <Columns>
        <DxDataGridDateEditColumn Field="@nameof(Order.OrderDate)" Width="240px" />
        <DxDataGridComboBoxColumn Field="@nameof(Order.CountryId)"
                                  Caption="Ship Country"
                                  Data="@Countries"
                                  ValueFieldName="@nameof(Country.Id)"
                                  TextFieldName="@nameof(Country.CountryName)"
                                  FilteringMode="DataGridFilteringMode.Contains"
                                  Width="250px" />
        <DxDataGridColumn Field="@nameof(Order.Product)" />
        <DxDataGridSpinEditColumn Field="@nameof(Order.UnitPrice)"
                                  DisplayFormat="c"
                                  Width="120px" />
    </Columns>
    <TotalSummary>

        <DxDataGridSummaryItem Field=@nameof(Order.UnitPrice)
                               SummaryType=SummaryItemType.Sum
                               DisplayFormat="Sum: {0:c}"/>
        <DxDataGridSummaryItem ShowInColumn=@nameof(Order.CountryId)
                               SummaryType=SummaryItemType.Count/>
        <DxDataGridSummaryItem Field=@nameof(Order.OrderDate)
                               SummaryType=SummaryItemType.Min
                               DisplayFormat="Earliest Date: {0:M}"
                               ShowInColumn=@nameof(Order.UnitPrice) />
    </TotalSummary>
</DxDataGrid>

Data Grid Summary in Another Column

For more information, refer to the following help topic: Summary.

See Also