Skip to main content
All docs
V25.1
  • DxTreeList.PageIndex Property

    Specifies the active page index.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [DefaultValue(0)]
    [Parameter]
    public int PageIndex { get; set; }

    Property Value

    Type Default Description
    Int32 0

    A zero-based value that specifies the active page index.

    Remarks

    Use the PageIndex property to switch between TreeList pages in code. You can handle the PageIndexChanged event to respond to page index changes.

    @inject EmployeeTaskService EmployeeTaskService
    
    <DxTreeList @ref="MyTreeList"
                Data="TreeListData"
                KeyFieldName="Id"
                ParentKeyFieldName="ParentId"
                AutoExpandAllNodes="true"
                @bind-PageIndex="@TreeListPageIndex">
        <Columns>
            <DxTreeListDataColumn FieldName="Name" Caption="Task" />
            <DxTreeListDataColumn FieldName="EmployeeName" />
            <DxTreeListDataColumn FieldName="StartDate" />
            <DxTreeListDataColumn FieldName="DueDate" />
        </Columns>
    </DxTreeList>
    
    @code {
        List<EmployeeTask> TreeListData { get; set; }
        int TreeListPageIndex { get; set; } = 1;
        ITreeList MyTreeList { get; set; }
    
        protected override void OnInitialized() {
            TreeListData = EmployeeTaskService.GenerateData();
        }
    }
    

    Blazor TreeList Page Index

    For more information about paging in the TreeList component, refer to the following topic: Paging in Blazor TreeList.

    Implements

    See Also