Skip to main content
All docs
V26.1
  • TreeListDataColumnCellDisplayTemplateContext.VisibleIndex Property

    Returns the visible index of the current row.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.Grid.v26.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public int VisibleIndex { get; }

    Property Value

    Type Description
    Int32

    The row’s visible index.

    Remarks

    Row Indexes

    The TreeList component assigns indexes to visible nodes to indicate row order. Indexes are zero-based and sequential across all TreeList pages.

    Row Indexes - All Pages

    DxTreeList reassigns row indexes each time a user sorts or filters data and expands/collapses rows. Filtered-out rows and rows within collapsed nodes do not have indexes. In the following image, the TreeList component does not assign indexes to subtasks of the Create Action Plan… task.

    Visible Indexes - Collapsed Items

    Example

    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 additional information and examples.

    See Also