Disable PreCount on Data grid

Hello I try to make a simple WebInterface for filtering throug a basic Log-Db.

The Problem is, that it contains 24Million+ entrys and on every PageLoad the Data Grid insists to do a count of the whole database, which takes solid 30 secs before the page loads at all (completely empty site).

Trys to solve this:

  • give a fake number via the Count Property but sadly it's ignored.
  • set ShowPagingSummary to false
  • googling for that issue, but no luck

My hacky workaround would be to make a own IEnumerable implementation witch mocks Count() to a static return of the ~24m. But first i want to see if there is a posibility to solve this correctly.
Many thanks in advance,
Best regards
Alex Barthel

@page "/"

<PageTitle>Logger Service</PageTitle>

@using LogServer.Data.Logs;
@using LogServer.Data.Models;

@inject GetLogsQuery _logsQuery


<RadzenDataGrid AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.Advanced"
               AllowSorting="true" PageSize="200" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
               ShowPagingSummary="true" Data="@AllData" TItem="LogServer.Data.Models.Log" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.And"
               Count="1000">
   <Columns>
      <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Channel" Title="Channel" Width="30px" />
      <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Created" Title="Created" Width="40px" />
      <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Entrytype" Title="Entrytype" Width="25px" />
      <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Username" Title="Username" Width="40px" />
      <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Message" Title="Message" />
   </Columns>
</RadzenDataGrid>


@code {
    private IEnumerable<Log> AllData = null ;

    protected override async Task OnInitializedAsync()
    {
        AllData = _logsQuery.GetUnfiteredLogs(); //returns the DataSet of the Table as suggested in the component example.
        await base.OnInitializedAsync();
    }
}

Second small issue: When i add Allow Virtualization="true" to the setup of the Data Grid, the page does not load at all (or at least longer than 3 minutes) what could that be?

EDIT: With the help of a few different Component pages/example i found the way to use Virtualization (with an own LoadData implementation and therefore i cound fake the Datacount on load to a reasonable number (so that the scrollbar is usable at all) and count only when it is filtered.)
it now only takes 2-3 seconds to load which is reasonable.
i guess the variant without Virtualization would work with a own LoadData implementation as well. I Guess this "issue" solved itself. For anybody having the same problem, heres my code:

@page "/test"

<PageTitle>Logger Service</PageTitle>

@using System.Linq.Dynamic.Core
@using LogServer.Data.DB;
@using LogServer.Data.Logs;
@using LogServer.Data.Models;

@inject ApplicationDbContext _context
@inject ICookie _cookie


<RadzenDataGrid @ref=grid AllowFiltering="true" AllowColumnResize="true" AllowVirtualization="true" LoadData="@LoadData"
                AllowAlternatingRows="false" FilterMode="FilterMode.Advanced"
                AllowSorting="true" PageSize="@pageSize" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
                ShowPagingSummary="true" Data="@logs" TItem="LogServer.Data.Models.Log" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.And"
                Count="@count" VirtualizationOverscanCount="100">
    <Columns>
        <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Channel" Title="Channel" Width="8%" />
        <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Created" Title="Created" Width="8%" />
        <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Entrytype" Title="Entrytype" Width="8%" />
        <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Username" Title="Username" Width="8%" />
        <RadzenDataGridColumn TItem="LogServer.Data.Models.Log" Property="Message" Title="Message" />
    </Columns>
</RadzenDataGrid>

@code {
    RadzenDataGrid<Log> grid;
    private int count = 24000000;
    private int pageSize = 100;
    IEnumerable<Log> logs;

    protected override async Task OnInitializedAsync()
    {
        logs = _context.Logs.Take(pageSize);
        await base.OnInitializedAsync();
    }

    void LoadData(LoadDataArgs args)
    {

        var query = _context.Logs.AsQueryable();

        if (!string.IsNullOrEmpty(args.Filter))
        {
            query = query.Where(args.Filter);
            count = query.Count();
        }
        else
        {
            count = 24000; //DO NOT COUNT THE DATABASE
        }

        if (!string.IsNullOrEmpty(args.OrderBy))
        {
            query = query.OrderBy(args.OrderBy);
        }

        logs = query.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
    }
}