DxDataGridSummaryItem.Alignment Property

Specifies the summary item’s alignment.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.2.dll

Declaration

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

Property Value

Type Default Description
DataGridTextAlign

Auto

A DataGridTextAlign enumeration value.

Available values:

Name Description
Auto

Automatically aligns the text in the column.

Left

Displays the text at the left side of the column.

Center

Displays the text in the center of the column.

Right

Displays the text at the right side of the column.

Justify

The text is justified.

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

See Also