Skip to main content
All docs
V25.1
  • DxTreeListColumn.WidthChanged Event

    Fires when column width changes.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [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();
        }
    }
    

    TreeList: Change Width

    See Also