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

TreeListFocusedRowChangedEventArgs.VisibleIndex Property

Returns the visible index of the focused row.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public int VisibleIndex { get; }

#Property Value

Type Description
Int32

If a data row is focused, the property returns this row’s visible index. The property returns -1 if a new row is focused or the TreeList displays no rows.

#Remarks

The following example displays the focused row’s visible index:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            FocusedRowEnabled="true"
            FocusedRowChanged="e => rowNumber = e.VisibleIndex + 1">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>
<text>The focused row number is @rowNumber</text>
@code {
    List<EmployeeTask> TreeListData { get; set; }
    int rowNumber { get; set; }

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

Refer to the TreeListFocusedRowChangedEventArgs class description for more information.

See Also