DxTreeList.GetVisibleRowCount() Method
Returns the total number of visible rows in the TreeList.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
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;
}
}
For more information about paging in the TreeList component, refer to the following topic: Paging in Blazor TreeList.
See Also