Skip to main content
A newer version of this page is available. .

GridTextAlignment Enum

Lists values that specify how text is aligned.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum GridTextAlignment

Members

Name Description
Auto

Aligns the text in the column based on cell content and column data type.

Left

Aligns cell text to the left.

Center

Centers the text.

Right

Aligns cell text to the right.

Related API Members

The following properties accept/return GridTextAlignment values:

Remarks

Use the TextAlignment property to specify how the text is aligned in the Grid’s column.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="GridDataSource">
    <Columns>
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice"
                          TextAlignment="GridTextAlignment.Left" />
        <DxGridDataColumn FieldName="QuantityPerUnit"
                          TextAlignment="GridTextAlignment.Center" />
        <DxGridDataColumn FieldName="UnitsInStock" />
        <DxGridSelectionColumn Width="80px" TextAlignment="GridTextAlignment.Right"></DxGridSelectionColumn>
    </Columns>
    <TotalSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Max" FieldName="UnitPrice" />
    </TotalSummary>
</DxGrid>

@code {
    IEnumerable<object> GridDataSource { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        GridDataSource = Northwind.Products.ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

The Grid's column text alignment

See Also