Server-Side Row Model
Server-side pagination, sorting, and filtering powered entirely by Blazor — no AG Grid Enterprise license required.
Single Round-Trip Architecture
DataGridRowModelType.BlazorServerSide
uses AG Grid's free clientSide row model under the hood,
but all data loading is orchestrated from C# via a single JS→C# interop call that returns data directly.
No Enterprise license required, no second C#→JS push needed.
- No Enterprise license: uses AG Grid Community only (~200KB)
- Single interop trip: JS calls C#, C# returns data immediately
- Any data source:
OnServerDataRequest,ServerDataProvider, or subclass override - Loading overlay: shown while fetching, hidden on completion
Blazor Method Call (OnServerDataRequest)
The simplest pattern: pass an async Func to OnServerDataRequest and apply sorting, filtering, and pagination in C#.
—Custom ServerDataProvider
Pass an IDataGridServerDataProvider to ServerDataProvider to target any external endpoint. The built-in priority is: ServerDataProvider → OnServerDataRequest → virtual OnFetchServerDataAsync.
How ServerDataProvider Works
Subclass HttpDataGridProvider<TItem> and override
ConfigureRequestAsync to inject auth headers, tenant IDs,
or custom query parameters. The base class handles serialising the request and deserialising the response.
Simulated Latency (Loading Overlay)
Demonstrates the loading overlay during an 800 ms simulated server delay, showing that the single-trip architecture gracefully handles async operations.
Row Selection Across Pages
Demonstrates that row selections survive page navigation and server refetches. Select rows on any page, navigate away and back — selections are preserved.
How Cross-Page Selection Works
IdFieldis the key — the grid uses it to match incoming rows to previously selected IDs.- When you navigate to a new page, the currently selected IDs are sent back to the server fetch handler, which re-checks any rows on the new page that were already selected.
- Applying a sort or filter resets to page 1 but preserves existing selections for any rows that remain visible after filtering.
@bind-SelectedItemsalways reflects the full cross-page selection set in Blazor.
FilterBuilder Integration
Replace built-in column filters with a FilterBuilder toolbar. No columns have Filterable — all filtering is owned by the FilterBuilder and applied server-side via the ApplyFilter() LINQ extension.
How FilterBuilder + DataGrid Works
- No
Filterable="true"on any column — column header menus have no filter option. OnFilterChangefires immediately on every condition change, stores theFilterGroup, and callsRefreshAsync()on the grid.- The request handler applies the
FilterGroupviaApplyFilter()— a built-in LINQ extension that handles all operator types using the sameFilterConditionobjects directly. - Column sorting still works normally alongside FilterBuilder filters.