Portfolio / AG Grid / Blazor / ASP.NET

AG Grid โ€” Server-Side Data Loading

A production-style AG Grid pattern where the browser does not need to load the complete dataset. Pagination, sorting and filtering are sent back to the application layer, which requests only the required records from the server.

AG Grid 29 JavaScript Interop Blazor ASP.NET API SQL Server

Architecture

1. AG GridPage / sort / filter
2. aggridh.jsJS interop
3. Blazor + APIBuilds request
4. SQL ServerReturns one page

This portfolio demo uses a small in-browser data source so it can run on a static Eleventy site. The request panel below mirrors the server-side contract used by the Employee_Client implementation; the real application sends these values through Blazor to its ASP.NET API and database.

Interactive Demo

Loading page 1...

Example server request

Waiting for the first grid request...

How the Employee_Client implementation works

The original implementation keeps the grid UI in JavaScript while the data operation remains in Blazor. When the grid changes sort or filter state, aggridh.js collects the active conditions and invokes the .NET method. The Blazor method then calls the API with the current page, page size, filter JSON and sort columns.

AG Grid
   โ†“
onSortChanged / filter state
   โ†“
aggridh.js
   โ†“
DotNetObjectReference โ†’ LoadGridDataAsync(...)
   โ†“
AuthApiService.GetPaginatedComplaintsAsync(
    pageNumber,
    pageSize,
    filtersJson,
    sortCols
)
   โ†“
ASP.NET API
   โ†“
SQL Server
   โ†“
PaginatedResult
   โ†“
AG Grid row data

Key implementation details

  • Only the requested page is fetched instead of loading the complete dataset into the browser.
  • AG Grid sort state is converted into server-friendly Column:Direction values.
  • AG Grid filter models are converted into structured filter conditions before the API call.
  • Blazor remains responsible for application state and the API call; JavaScript handles the grid lifecycle.
  • The approach works well for large SQL-backed tables where browser-side filtering would become expensive.

๐Ÿ’ฌ Comments

Sign in with Google to publish immediately, or comment anonymously and wait for approval.

Comments will appear here when available.