DataGrid Virtualization calls LoadData 5 times on initial creation #337

Closed
opened 2026-01-29 17:35:35 +00:00 by claunia · 0 comments
Owner

Originally created by @dxrdxr on GitHub (Mar 4, 2022).

Describe the bug
When running the Demo datagrid-virtualization-loaddata place a tracepoint in the LoadData method and observe it being called 5 times. When trying to use this as a sample to build my own virtualization DataGrid I also see the same behavior. Because it is a REST service call, 5 times is rather expensive!

To Reproduce
Steps to reproduce the behavior:

  1. Load the datagrid-virtualization-loaddata in Visual Studio
  2. Add a Tracepoint at the top of LoadData to print out the Skip and Top
  3. See 5 calls

Expected behavior
One call

TracePoint example

Calling InvokeLoadData from DataGrid.Reload
Called LoadData Skip 0 Top 10
Calling InvokeLoadData from LoadItems
Called LoadData Skip 0 Top 10
Calling InvokeLoadData from LoadItems
Called LoadData Skip 0 Top 16
Calling InvokeLoadData from LoadItems
Called LoadData Skip 1 Top 16
Calling InvokeLoadData from LoadItems
Called LoadData Skip 0 Top 20

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Edge (Chromium)
  • Version 98.0.1108.62 (Official build) (64-bit)
Originally created by @dxrdxr on GitHub (Mar 4, 2022). **Describe the bug** When running the Demo `datagrid-virtualization-loaddata` place a tracepoint in the `LoadData` method and observe it being called 5 times. When trying to use this as a sample to build my own virtualization DataGrid I also see the same behavior. Because it is a REST service call, 5 times is rather expensive! **To Reproduce** Steps to reproduce the behavior: 1. Load the `datagrid-virtualization-loaddata` in Visual Studio 2. Add a Tracepoint at the top of `LoadData` to print out the Skip and Top 3. See 5 calls **Expected behavior** One call **TracePoint example** ``` Calling InvokeLoadData from DataGrid.Reload Called LoadData Skip 0 Top 10 Calling InvokeLoadData from LoadItems Called LoadData Skip 0 Top 10 Calling InvokeLoadData from LoadItems Called LoadData Skip 0 Top 16 Calling InvokeLoadData from LoadItems Called LoadData Skip 1 Top 16 Calling InvokeLoadData from LoadItems Called LoadData Skip 0 Top 20 ``` **Desktop (please complete the following information):** - OS: Windows 11 - Browser Edge (Chromium) - Version 98.0.1108.62 (Official build) (64-bit)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#337