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

TreeListDataColumnCellDisplayTemplateContext.VisibleIndex Property

Returns the visible index of the current 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

The row’s visible index.

#Remarks

#Row Visible Indexes

Visible indexes indicate the order of visible data rows. Indexes are zero-based and sequential for rows on all TreeList pages.

Visible Indexes - All Pages

The TreeList reassigns row indexes each time a user sorts or filters data and expands/collapses rows.

The following rows do not have visible indexes:

  • Rows that are filtered out.
  • Child rows of collapsed items

Visible Indexes - Filter is Applied

Visible Indexes - Collapsed Items

The following code snippet creates a TreeList column that displays visible indexes for rows:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
    <Columns>
        <DxTreeListDataColumn Caption="Visible Index">
            <CellDisplayTemplate>@context.VisibleIndex</CellDisplayTemplate>
        </DxTreeListDataColumn>
        <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();
    }
}

Refer to the DxTreeList.DataColumnCellDisplayTemplate and DxTreeListDataColumn.CellDisplayTemplate property descriptions for more information and examples.

See Also