DataGridRenderEventArgs.Grid.Count count wrong when DataGrid is virtualized

I have a DataGrid on which i have subscribed to the Render action with a custom method that takes DataGridRenderEventArgs as a parameter. I use the DGREA to count the number of rows in the table using args.Grid.Count. I do it this way because i need to see the actual number of elements in the Grid since columns can be filtered.

When the Grid has virtulization disabled, this works flawlessly.
But when virtulization is enabled will the Count allways return 1 (as long as it is not empty, then it will say 0).

Is there an otherway i can count the elements actually shown in the grid?


  • the Grid does not have pages
  • the Grid needs to be virtualized since it contains hundreds of rows and has a pretty expensive custom cellrender method.
  • the project is Blazor server in .NET 6
  • The nuget package has been updated to the newest stable version.


Virtualization and paging are virtually the same from data query perspective. Count property value is actually the total number of records not how many rows are displayed and it depends on how the DataGrid is bound: if bound using LoadData the developer must set the property.