DataGrid Virtualization Doesn't Work when height set to >525px

When using virtualisation I'm setting height to >525 and the data doesn't virtualize correctly. In this instance I'm trying to set height to 700px. This particular list below has 18 items and it is only rendering the inital 10. If I change height back to 500, it renders correctly.

As you can see the grid is allocating enough space, but it is not rendering.

<RadzenDataGrid AllowFiltering="true" AllowColumnResize="true" AllowSorting="true"
				Data="@Workers" TItem="AxionUser" LogicalFilterOperator="LogicalFilterOperator.And" FilterMode="FilterMode.Simple" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowPaging="false" AllowVirtualization="true" Style="height:525px" >

Hi @Andre,

Try increasing the PageSize of your DataGrid. By default it is 10 and this is how many items are fetched and rendered.

Thanks, that does fix it.

So it would appear even when you start scrolling it doesn't try fetch new items.

This also affects the Radzen Demo at Free Blazor Components | 60+ controls by Radzen

If you filter the ORDERID to a value less than say 10254 then when you scroll down there are blank records for the last few rows. Is there a better fix than just increasing the PageSize as it is not obvious that PageSize would effect Virtualization mode

Regards
Brian

There isn't another fix. We can't just fetch all items from the database so that's why virtualization relies on PageSize.

question...

How can i know what page size is correct for the given height?
e.g. height = 100px pagesize=50. is this working?
Or is it as simple as "pagesize * rowheight in px must be greater than height in px?"

i cant get a feeling for "which pagesize is best for which height"

kind regards
Thomas

Yes, precisely!

You need to set the PageSize to at least as many items as currently visible. It depends entirely on the DataGrid height and row height. The default row height is 38px.

Thanx @korchev!
This is easy to handle.

Thomas

Hi Korchev.
Is there a way to calculate row height?
I Have a customized grid and sometimes it would include layouts with bigger components than the common 38px height you mentioned, and i need virtualization.

Thanks.

We rely completely on Blazor Virtualize component, you can check our code for reference.

This thread might be useful for you as well:

Row height depends on the size of the delete button. I needed smaller row size and it was not resized until I put icon size as Size="ButtonSize.ExtraSmall"