Skip to content

Commit

Permalink
Fix #801 by removing direct call to Items.Count() (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Oct 6, 2023
1 parent 5d2b112 commit 497ee86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/Components/DataGrid/FluentDataGrid.razor
Expand Up @@ -29,7 +29,8 @@
@_renderColumnHeaders
</FluentDataGridRow>
}
@if (Items?.Count() == 0 || _ariaBodyRowCount == 0)

@if (_ariaBodyRowCount == 0)
{
<div class="empty-content">
@if (EmptyContent is null)
Expand Down
1 change: 1 addition & 0 deletions src/Core/Components/DataGrid/FluentDataGrid.razor.cs
Expand Up @@ -409,6 +409,7 @@ private async ValueTask<GridItemsProviderResult<TGridItem>> ResolveItemsRequestA
else if (Items is not null)
{
int totalItemCount = _asyncQueryExecutor is null ? Items.Count() : await _asyncQueryExecutor.CountAsync(Items);
_ariaBodyRowCount = totalItemCount;
IQueryable<TGridItem>? result = request.ApplySorting(Items).Skip(request.StartIndex);
if (request.Count.HasValue)
{
Expand Down

0 comments on commit 497ee86

Please sign in to comment.