Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTreeListColumn.WidthChanged Event

Fires when column width changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<string> WidthChanged { get; set; }

#Parameters

Type Description
String

The new Width property value.

#Remarks

You can specify the column’s Width property value in any absolute or relative units that your browser supports. The WidthChanged event fires when a column’s width changes.

In the following code snippet, the WidthChanged event fires after a user resizes the Date column:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            ColumnResizeMode="TreeListColumnResizeMode.NextColumn">
    <Columns>
        <DxTreeListSelectionColumn Width="100px" />
        <DxTreeListDataColumn FieldName="Name" Caption="Task" Width="400px" WidthChanged="@OnWidthChanged" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

The new width: @Message

@code {
    List<EmployeeTask> TreeListData { get; set; }
    string Message { get; set; }
    void OnWidthChanged(string NewValue) {
        Message = NewValue;
    }

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

See Also