Skip to main content
All docs
V24.1

DxTreeListColumn.TextAlignment Property

Specifies the alignment of text in column cells.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(TreeListTextAlignment.Auto)]
[Parameter]
public TreeListTextAlignment TextAlignment { get; set; }

Property Value

Type Default Description
TreeListTextAlignment Auto

An enumeration value.

Available values:

Name Description
Auto

Aligns text based on cell content and column data type.

Left

Aligns cell text to the left.

Center

Centers cell text.

Right

Aligns cell text to the right.

Remarks

The TreeList component aligns the contents of data and footer cells based on the cell data type and column type. For example, the default behavior of the DxTreeListSelectionColumn is to center its content.

The default text alignment

Use the TextAlignment property to change the text alignment in column cells. The following example applies this property:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
    <Columns>
        <DxTreeListSelectionColumn TextAlignment="TreeListTextAlignment.Right" Width="100px" />
        <DxTreeListDataColumn FieldName="Name" Caption="Task" Width="40%" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    List<EmployeeTask> TreeListData { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
}

The TreeList's column text alignment

Use the following properties to align column captions:

Implements

See Also