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

DxTreeList.GetVisibleRowCount() Method

Returns the total number of visible rows in the TreeList.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public int GetVisibleRowCount()

#Returns

Type Description
Int32

The number of visible rows.

#Remarks

The GetVisibleRowCount method returns the number of visible rows displayed in all TreeList pages. This number does not include filtered out rows and child rows of collapsed items.

@inject EmployeeTaskService EmployeeTaskService

<style>
    .my-button{
        width:200px;
    }
</style>

<DxTreeList @ref="MyTreeList"
            Data="TreeListData"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>
<p />
<DxButton Click="OnGetVisibleRowCount" Text="Get Visible Row Count" CssClass="my-button"/>
<p />
@Alert

@code {
    List<EmployeeTask> TreeListData { get; set; }
    ITreeList MyTreeList { get; set; }
    string Alert { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
    void OnGetVisibleRowCount() {
        int count = MyTreeList.GetVisibleRowCount();
        Alert = "The visible row count equals " + count;
    }
}

TreeList - Get Visible Row Count

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

See Also