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.VisibleIndexChanged Event

Fires when the column’s visible index changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<int> VisibleIndexChanged { get; set; }

#Parameters

Type Description
Int32

A new VisibleIndex property value.

#Remarks

The VisibleIndex property allows you to define display order for TreeList columns explicitly. Users can then reorder columns at runtime. Handle the VisibleIndexChanged event to respond to column position changes.

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" VisibleIndex="@CurrentIndex"
                              VisibleIndexChanged="OnVisibleIndexChanged" />
        <DxTreeListDataColumn FieldName="EmployeeName"  />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

<div>@IndexInfo</div>

@code {
    int CurrentIndex { get; set; }
    string IndexInfo { get; set; }
    List<EmployeeTask> TreeListData { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
    void OnVisibleIndexChanged(int newIndex) {
        CurrentIndex = newIndex;
        IndexInfo = "You moved the 'Task' column to position " + (newIndex + 1);
    }
}

Set the DxTreeList.AllowColumnReorder or DxTreeListColumn.AllowReorder property to false to prevent users from reordering columns.

See Also