Virtualization not working in RadzenDataGrid

I have a RadzenDataGrid bound to an IQueryble configured to use virtualization just like in the online demo. Now that the data is increasing I see that the virtualization ist not working as expected. In EF-Core Query-Logs I can see that first there are 2 calls are made to fetch all datasets (no skip, top) which are really slow. Afterwards all seems to be worked as expected, since follow up calls are only partials. I removed anything but the bare DatGrid definition.

Any help would be greatly appreciated.

Check if you have height specified.

Hello @enchev ,

I tried specifying a height but this didn’t changed anything. Please see my simplified code below:

	<RadzenDataGrid @ref="TabelleArbeitszeit"
					TItem="Arbeitszeiteintrag"
					Data=@Arbeitszeiteintraege
					AllowFiltering="false"
					AllowSorting="false"
                    AllowVirtualization="true"
					Style="height: 300px"
					FilterMode="FilterMode.Simple" >
		<Columns>
			...
	</Columns>
</RadzenDataGrid>

Arbeitszeiteintraege is a IQueryable.

Actually it seems like the RadzenDataGrid would trigger two unfiltered database calls before applying the correct virtualization settings…

Feel free to post runnable example code replicating the problem. You can use our demos for reference - they are editable.

Hallo @enchev,

thanks for your reply. I would really like to do so but it’s not that easy to realise with the online samples. To reproduce what I see in my local logs I need to enable EFCore-Logging to see what queries are actually send to the database, but I am not able to do so in the playground without having access to the program.cs…

You can always upload an entire app zipped somewhere like Google Drive and post a link here.

TestApp.zip (1.9 MB)

Hello @enchev,

I build an testapp fro reproducing the issue and attached it to this thread. In the main console of the application you can see the SQL-querries beeing executed.

As you can see in my screenshot, there are

  • 2 Fully queries of the table
  • 1 query of table count
  • x partial queries of the virtualization

The 2 fully queries at the beginning don’t make sense here, because they are destroying benefits of using virtualization here. In the sample app this has no big influence but it has once you start using more complex data structures.

As I already mentioned in my previous replies, you need to set a height for the DataGrid.

Hello @enchev,

yes I forgot to add this in my sample project. But as already mentioned in a previous post this doesn’t solve the issue. I added a modified version so you can prove yourself.

TestApp.zip (2.0 MB)

I’ve just published update to Radzen.Blazor (10.4.1) - you can disable also prerender (`<Routes @rendermode="new InteractiveServerRenderMode(prerender: false)" />`) to minimize even more the database calls.

Hello @enchev ,

thank you very much for the update :+1: . That small bugfix improved the loading times of my DataGrid massively :stopwatch: