DxDataGridSummaryItem.Alignment Property

Specifies the summary item's alignment.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

Declaration

[Parameter]
[DefaultValue(DataGridTextAlign.Auto)]
public DataGridTextAlign Alignment { get; set; }

Property Value

Type Default Description
DataGridTextAlign

Auto

A DataGridTextAlign enumeration value.

Remarks

To calculate total summaries in the Data Grid, add DxDataGridSummaryItem objects to the TotalSummary collection.

The Data Grid aligns summary values in the same way as values in the corresponding column (based on the column's TextAlignment property value). You can use the summary item's Alignment property to change the alignment.

NOTE

This 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.OrderDate)
                               SummaryType=SummaryItemType.Min
                               DisplayFormat="First: {0:D}"/>
        <DxDataGridSummaryItem Field=@nameof(Order.UnitPrice)
                               SummaryType=SummaryItemType.Sum
                               DisplayFormat="Sum: {0:c}"
                               Alignment="DataGridTextAlign.Left"/>
        <DxDataGridSummaryItem ShowInColumn=@nameof(Order.CountryId)
                               SummaryType=SummaryItemType.Count
                               Alignment="DataGridTextAlign.Center"/>
    </TotalSummary>
</DxDataGrid>

Data Grid Summary Alignment

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

See Also