Unlike server-side applications, Blazor WebAssembly applications run inside the browser. Therefore, they do not have direct access to the data in the server as server-side applications have. Instead, they need to request the data to the server.

When displaying a collection of items in a control, like FlexGrid or ListView, the data can be fetched before, and if the data set is small enough, it will show up after a brief lapse of time. But if the data set is big, bringing all the data causes significant delay in loading the page as well as a misuse of network resources.

Data Virtualization

Data Virtualization is the ability to work with a dataset before all the data is downloaded. It is also referred to as on-demand loading or incremental loading; with data virtualization, the data is downloaded in chunks only if necessary. The way the data is downloaded improves the load time and uses network resources more efficiently.

In this post, we will demonstrate how to implement data virtualization in a Blazor WebAssembly application. We will modify the Weather Forecast sample that comes with the default Blazor project template. I will show the following steps:

  1. Create a Blazor WebAssembly project
  2. Modify the MVC API Controller
  3. Create a Virtual DataCollection
  4. Bind FlexGrid to the DataCollection

#dotnet #blazor #webassembly #developer

How to Implement Data Virtualization in a Blazor WebAssembly App
22.05 GEEK