▶ Live demo: https://vaclavelias.github.io/QuickGrid.Toolkit/
QuickGrid.Toolkit extends the Blazor QuickGrid with reusable, dynamic column management and small UI utilities. It is especially useful when you render the same kind of data in multiple places but need different visible columns per grid: you declare every possible column once in a ColumnManager<T>, and because the column configuration is just data, the same setup can drive several grids that each show a different subset.
Twelve example pages, from the low-level building blocks to a full application-grade setup. Every page runs in the live demo; sources live under src/QuickGrid.Samples.Shared/Pages/Examples and are registered in ExampleRegistry.cs.
| Example | Shows | Source |
|---|---|---|
| QuickGrid + ColumnManager | Your own <QuickGrid> with columns rendered from a ColumnManager, plus a ColumnSelector - the low-level pattern |
UsersGrid.razor |
| QuickGridWrapper | The same columns in one component with toolbar, quick search and a column selector | UsersGridWrapper.razor |
| Column Types | Every column helper side by side: text, dates, numbers, ticks, toggles, markup, images, templates and actions | ColumnTypes.razor |
| Formatting & Styling | Format strings, conditional cell styling with CellStyleMap, row classes, shared ColumnInfo definitions |
FormattingStyling.razor |
| Loading, Paging & Refresh | IsLoading, pagination, and keeping the grid in step with data that changes underneath it (ItemsVersion) |
LoadingPaging.razor |
| Search & Filtering | Quick search across every column, -word exclusions, exact match, nested properties, and your own filter panel |
SearchFiltering.razor |
| Row Selection | Selecting rows with ISelectionDto and acting on the selection from the toolbar |
RowSelection.razor |
| Footers & Totals | Automatic totals for numeric columns, or hand-built footer cells for full control | FootersTotals.razor |
| Column Visibility | Showing and hiding columns from your own controls, and refreshing what the wrapper derives from them | ColumnVisibility.razor |
| Export | Wiring the export events to produce a CSV of what the user is currently looking at | Export.razor |
| Saved Views & Icons | Column layouts as named views, and swapping the toolbar icons for your own | SavedViews.razor |
| Your Own Grid Component | Subclassing QuickGridWrapper once to fix the styling and wire the events for a whole application |
AppQuickGridExample.razor |
Legend: ⏳ planned. The Example column links to the live demo page showing the feature.
| Feature | Example |
|---|---|
Add columns dynamically at runtime with ColumnManager<T> |
QuickGrid + ColumnManager |
| One column setup reused across grids - each grid shows a different subset | QuickGridWrapper |
Show/hide column selection UI (ColumnSelector) |
QuickGrid + ColumnManager |
Drive column visibility from your own UI, then RefreshColumnsAsync() to realign the headers |
Column Visibility |
Predefined, strongly-typed helpers via extension methods (e.g. AddCountry()) |
QuickGrid + ColumnManager |
Every Add* returns the column it created, so it can be configured or totalled inline |
Footers & Totals |
| Sorting for added columns | Column Types |
| Per-column visibility, alignment, format and CSS class | Formatting & Styling |
Saved column views / layouts (durable persistence is the host's job, via Events) |
Saved Views & Icons |
| Column type | Example |
|---|---|
Index column (AddIndexColumn) |
Column Types |
Value column (AddSimple) |
Column Types |
Number column, int / double / decimal (AddNumber) |
Column Types |
Styled number with conditional cell styling (AddStyledNumber) |
Formatting & Styling |
Date column (AddSimpleDate) |
Column Types |
Tick / boolean column (AddTickColumn, with true/false styling) |
Column Types |
Toggle column (AddToggleColumn, with change callback) |
Column Types |
Image column (AddImageColumn) |
Column Types |
Template column (AddTemplateColumn, custom RenderFragment) |
Column Types |
Markup column (AddMarkup, raw HTML) |
Column Types |
Clickable / action columns with callbacks (AddAction) |
Column Types |
| Feature | Example |
|---|---|
Conditional cell styling (CellStyleMap) |
Formatting & Styling |
Value markers by sign - AddStyledNumber marks each value negative / positive / zero; your CSS supplies the colours |
Formatting & Styling |
Choose which markers a grid emits (ColumnManager.ValueStyles) |
Formatting & Styling |
| Custom column styling (CSS class per column) | Formatting & Styling |
Custom row styling (row classes, CSS :has()) |
Formatting & Styling |
Utility CSS classes: table-index, table-fit, table-thead-sticky, table-no-empty-lines |
- |
| Feature | Example |
|---|---|
| Quick search across all columns | QuickGridWrapper |
| Nested / child-property search | Search & Filtering |
| Exact-match toggle | Search & Filtering |
Exclude a term with -word |
Search & Filtering |
Per-grid search options (SearchOptions: depth, case sensitivity, AND/OR, included/excluded columns) |
Search & Filtering |
Preset / external search value (QuickSearch) |
Search & Filtering |
Custom filter panel (FilterSection) |
Search & Filtering |
EF-backed server filtering (FilterCriteria) |
⏳ example planned |
Pagination, loading indicator, data refresh (ItemsVersion) |
Loading, Paging & Refresh |
Row selection (ISelectionDto) with bulk actions |
Row Selection |
| Toolbar with settings menu | QuickGridWrapper |
Pluggable icons (IQuickGridIconProvider, Bootstrap Icons by default) |
Saved Views & Icons |
| App-wide defaults by subclassing the wrapper | Your Own Grid Component |
| Feature | Example |
|---|---|
Automatic total footer - sums numeric columns (TotalFooter) |
Footers & Totals |
Per-column total control (CalculateTotal) |
Footers & Totals |
Manual footer cells (AddFooterColumn, AddFooterColumnWithSum) |
Footers & Totals |
Column header tooltips from full titles (needs the wrapper Id) |
Footers & Totals |
| Feature | Example |
|---|---|
Export to CSV (the wrapper raises Events; writing the file is up to the host) |
Export |
| Export selected columns only | Export |
| ⏳ Export to JSON | - |
- .NET 10
- Bootstrap 5
- Icons: either include Bootstrap Icons
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">- or provide your own implementation of
IQuickGridIconProvider
- Toolkit CSS (Static Web Asset):
<link rel="stylesheet" href="@Assets["_content/QuickGrid.Toolkit/app.css"]" />- it covers layout, the toolbar and utility classes only; colouring values by their nature is opt-in, see Styling values by their nature
The snippets below assume you already use Blazor and QuickGrid. Each mirrors a sample page, open the linked source for the full, runnable version.
Full control of the QuickGrid markup while the toolkit manages columns and the selection UI. See UsersGrid.razor · live.
<ColumnSelector ColumnManager="_columnManager" SelectionChanged="SelectionChangedAsync" />
<QuickGrid @ref="_grid" Items="@_items.AsQueryable()" Theme="twentyAI"
Class="table table-sm table-index table-striped small table-fit table-thead-sticky mb-0">
@QuickGridColumns.Columns(_columnManager)
</QuickGrid>
@code {
private List<UserDto> _items = new();
private ColumnManager<UserDto> _columnManager = new();
private QuickGrid<UserDto>? _grid;
protected override void OnInitialized()
{
_columnManager.AddIndexColumn();
_columnManager.AddSimple(p => p.Name, fullTitle: "Name");
_columnManager.AddToggleColumn(p => p.RemoteWorking, "Remote", fullTitle: "Remote Working", onChange: ToggleChange);
_columnManager.AddCountry();
_items = UserService.GetUsers();
}
private async Task SelectionChangedAsync() // call after the selection changes
{
if (_grid is not null) await _grid.RefreshDataAsync();
}
private async Task ToggleChange(UserDto user) { /* ... */ }
}Key points:
ColumnManager<T>defines all possible columns (predefined helpers likeAddCountry()plus custom ones likeAddToggleColumn(...)).ColumnSelectorrenders the show/hide UI; callRefreshDataAsyncwhen the selection changes.QuickGridColumns.Columns(_columnManager)renders the currently visible columns.
When several grids share similar data but different columns, the wrapper centralizes the grid markup, toolbar, quick search and pagination, you keep just the per-page column configuration. See UsersGridWrapper.razor · live.
<QuickGridWrapper Items="@_items.AsQueryable()" ColumnManager="_columnManager" />You pass Items and a configured ColumnManager<T>; the column setup is identical to example 1.
Add TotalFooter and an Id to a QuickGridWrapper to get an automatic totals row, numeric columns are summed for you. See FootersTotals.razor · live.
<QuickGridWrapper Items="@_items.AsQueryable()"
ColumnManager="_columnManager"
TotalFooter="_totalFooter"
Id="id-total-footer-example" />
@code {
private TotalFooter _totalFooter = new() { IsTotalFooter = true };
// numeric columns (AddNumber / AddStyledNumber) are totalled automatically;
// set CalculateTotal on a column to force a total on or off.
}The footer is rendered by a small ES module shipped with the toolkit (quickGridToolkit.js) that the wrapper imports automatically. It only appears when the wrapper has an Id, because that becomes the grid table's id.
dotnet run --project src/QuickGrid.Samples # Blazor Server (matches how the toolkit is typically consumed)
dotnet run --project src/QuickGrid.Samples.Wasm # standalone WebAssembly (what GitHub Pages hosts)Both hosts render the same example pages from the shared QuickGrid.Samples.Shared library. The live demo is published by the deploy-pages workflow.
table-index: adds a compact index column when used withAddIndexColumn().table-fit: reduces padding for dense layouts.table-thead-sticky: keeps the header row sticky.
AddStyledNumber wraps its value in <span content="...">, where the content describes the value's nature: negative, positive or zero. The toolkit ships no colours for these - styling them is opt-in, so a grid shows only the colours the application actually asked for. Add the natures you want to your own stylesheet:
td span[content="negative"] {
color: #b02a37;
}
td span[content="positive"] {
color: #146c43;
}
td span[content="zero"] {
color: #6c757d;
}Leave a rule out and that nature renders as ordinary text. A common choice is colouring negatives and greying zeros as noise while leaving positives plain. Scope the selectors - .my-report td span[content="negative"] - to vary the palette per grid.
To stop a grid emitting the markers at all, set ColumnManager.ValueStyles. A nature that is switched off produces no <span>, so there is nothing for CSS to undo:
_columnManager.ValueStyles = GridValueStyles.Negative | GridValueStyles.Zero;A CellStyleMap supplies your own content names instead of these three, and those are never suppressed.
- The
Formatproperty is not working forobjecttype (formatting is instead applied inside the column's rendered content).