Skip to main content
All docs
V24.2

DxTreeList.ColumnResizeMode Property

Specifies whether and how users can resize TreeList columns.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(TreeListColumnResizeMode.Disabled)]
[Parameter]
public TreeListColumnResizeMode ColumnResizeMode { get; set; }

Property Value

Type Default Description
TreeListColumnResizeMode Disabled

An enumeration value.

Available values:

Name Description
Disabled

A user cannot resize columns.

NextColumn

When a user resizes a column, the width of the column to the right changes (considering the MinWidth value), but the TreeList’s total width does not change. Users cannot change the width of the rightmost column.

ColumnsContainer

When a user resizes a column, all other columns retain their widths, but the width of the container that stores all TreeList columns changes.

Remarks

If the ColumnResizeMode property is set to Disabled (the default value), a user cannot change a column’s width at runtime.

To enable column resize operations, set the ColumnResizeMode property to one of the following values:

NextColumn

When a user resizes a column, the width of the column to the right changes (considering the MinWidth value), but the TreeList’s total width does not change. Users cannot change the width of the rightmost column.

TreeList - NextColumn Resize Mode

ColumnsContainer

When a user resizes a column, all other columns retain their widths, but the width of the container that stores all TreeList columns changes.

The TreeList fixes column widths specified in percentages. Fixed values are calculated in pixels. If the sum of all column widths (considering the MinWidth value) is greater than the container’s total width, TreeList displays the horizontal scrollbar. Otherwise, an empty space remains to the right.

TreeList - ColumnsContainer Resize Mode

If allowed, the following column resize operations are available to users:

  • Drag a column header’s right border.
  • Double-click a column’s right border to apply optimal width based on column content.

Note that a column before a fixed column is not resizable.

The following code snippet activates NextColumn resize mode:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            TextWrapEnabled="false"
            ColumnResizeMode="TreeListColumnResizeMode.NextColumn">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

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

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

Implements

See Also