Lumeo

DataGrid

A powerful data grid with sorting, filtering, pagination, selection, inline editing, column pinning, resizable columns, row editing, layout persistence, context menus, and CSV/Excel/JSON export.

Installation

dotnet add package Lumeo.DataGrid

One-time app setup (AddLumeo(), CSS & JS) is covered in the installation guide.

Usage

@using Lumeo

<DataGrid />

When to Use

  • Complex data grids with advanced features like sorting, filtering, and grouping
  • Enterprise table views with inline editing and cell-level validation
  • Column pinning and resizable columns for wide data sets
  • Scenarios requiring row selection, context menus, and data export (CSV/Excel/JSON)
  • Dashboards where the grid starts compact but the user can expand it to fullscreen for a full view
Alice JohnsonEngineering¤95,0002021-03-15
Bob SmithMarketing¤72,0002020-07-01
Carol WhiteEngineering¤105,0002019-11-20
David BrownSales¤68,0002022-01-10
Eve DavisEngineering¤98,0002020-05-05
Rows per page
1–5 of 12

A simple data grid with sortable columns and pagination.

Alice JohnsonEngineering¤95,000Active2021-03-15
Bob SmithMarketing¤72,000Active2020-07-01
Carol WhiteEngineering¤105,000Active2019-11-20
David BrownSales¤68,000Inactive2022-01-10
Eve DavisEngineering¤98,000Active2020-05-05
Rows per page
1–5 of 12

Enable the toolbar for global search, column visibility, and CSV export. Column filters appear as inline popovers.

Toolbar customization

The toolbar is composed of independent slots — Search, Columns, Export, and Expand — each togglable with its own parameter. Defaults preserve the full toolbar; opt-out by setting any of ShowSearch, ShowColumnChooser, ShowExport, or Expandable to false. For fine-grained control over which file formats appear in the Export dropdown, use the ExportFormats flags enum. This is especially useful in Blazor WebAssembly, where PDF generators like QuestPDF throw PlatformNotSupportedException — hide PDF by setting ExportFormats="DataGridExportFormat.Csv | DataGridExportFormat.Excel".

Alice JohnsonEngineering¤95,000
Bob SmithMarketing¤72,000
Carol WhiteEngineering¤105,000
David BrownSales¤68,000
Eve DavisEngineering¤98,000
Rows per page
1–5 of 12

Hide the Columns and Export buttons to give users a cleaner toolbar with just global search.

Alice JohnsonEngineering¤95,000
Bob SmithMarketing¤72,000
Carol WhiteEngineering¤105,000
David BrownSales¤68,000
Eve DavisEngineering¤98,000
Rows per page
1–5 of 12

Hide the search input and Columns button to keep only the Export dropdown — useful for read-only, report-style grids.

Alice JohnsonEngineering¤95,000
Bob SmithMarketing¤72,000
Carol WhiteEngineering¤105,000
David BrownSales¤68,000
Eve DavisEngineering¤98,000
Rows per page
1–5 of 12

Restrict the Export dropdown to CSV. Use this pattern in Blazor WebAssembly where PDF export libraries aren't supported.

Filtering Extensibility

Column filters pick sensible defaults from FilterType, but two extension points let you customize the experience per-column without forking the grid.

Restricting operators per column

Pass a List<FilterOperator> to the Operators parameter to limit which operators the built-in filter popover shows. The grid intersects this list with the defaults for the column's FilterType, so nonsensical combinations (e.g. StartsWith on a Number column) are filtered out automatically.

<DataGridColumnDef TItem="Employee"
                   Title="Name"
                   Field="Name"
                   Filterable="true"
                   Operators="@(new List<FilterOperator> { FilterOperator.Equals, FilterOperator.StartsWith })" />

Custom filter UI via FilterTemplate

For columns that need a bespoke experience (range sliders, relative-date pickers, tag pickers, ...), supply a FilterTemplate. The render fragment receives a DataGridFilterTemplateContext exposing the field name, the currently-applied FilterDescriptor (or null), and an Apply callback. Invoke Apply with a descriptor to commit the filter, or with null to clear it.

<DataGridColumnDef TItem="Employee" Title="Salary" Field="Salary" Filterable="true">
    <FilterTemplate Context="ctx">
        <Slider Min="0" Max="200000" Value="_min" ValueChanged="v => _min = v" />
        <Button OnClick="@(async () => await ctx.Apply(
            new FilterDescriptor(ctx.Field!, FilterOperator.GreaterThanOrEqual, _min, FilterType: DataGridFilterType.Number)))">
            Apply
        </Button>
        <Button Variant="Button.ButtonVariant.Ghost" OnClick="@(async () => await ctx.Apply(null))">
            Clear
        </Button>
    </FilterTemplate>
</DataGridColumnDef>

What is not pluggable today (tracked for a future release): registering brand-new FilterOperator values, combining column filters with OR logic, and LINQ-expression compilation for server-side evaluation. Filters are always AND-combined across columns; within a column you get one operator + value at a time.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Select multiple rows with checkboxes. The header checkbox toggles select all.

Alice JohnsonEngineering¤95,000
Bob SmithMarketing¤72,000
Carol WhiteEngineering¤105,000
David BrownSales¤68,000
Eve DavisEngineering¤98,000
Rows per page
1–5 of 12

Click a row to select it. Useful for master-detail views.

Alice JohnsonEngineering¤95,000Active2021-03-15
Bob SmithMarketing¤72,000Active2020-07-01
Carol WhiteEngineering¤105,000Active2019-11-20
David BrownSales¤68,000Inactive2022-01-10
Eve DavisEngineering¤98,000Active2020-05-05
Rows per page
1–5 of 12

Visual variants for different density needs.

¤95,000
Active
¤72,000
Active
¤105,000
Active
¤68,000
Inactive
¤98,000
Active
Rows per page
1–5 of 12

Use CellTemplate to render custom content like avatars, badges, and action buttons.

Alice JohnsonEngineeringActive
Bob SmithMarketingActive
Carol WhiteEngineeringActive
David BrownSalesInactive
Eve DavisEngineeringActive
Rows per page
1–5 of 12

Use DetailTemplate to show additional information when a row is expanded.

Engineering¤95,000Active2021-03-15
Marketing¤72,000Active2020-07-01
Engineering¤105,000Active2019-11-20
Sales¤68,000Inactive2022-01-10
Engineering¤98,000Active2020-05-05
Rows per page
1–5 of 12

Pin columns to the left or right edge so they stay visible while scrolling horizontally.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Drag the column border to resize. All columns are resizable by default. Use MinWidth and MaxWidth to constrain sizing.

Alice JohnsonEngineeringActive
Bob SmithMarketingActive
Carol WhiteEngineeringActive
David BrownSalesInactive
Eve DavisEngineeringActive
Rows per page
1–5 of 5

Click a cell to edit it inline. Press Enter to commit, Escape to cancel.

Alice JohnsonEngineeringActive
Bob SmithMarketingActive
Carol WhiteEngineeringActive
Rows per page
1–3 of 3

Edit cells inline as in Cell mode, but commits land in a per-row pending-changes buffer. A pending strip and Save all / Discard buttons appear above the grid. Optional + Add row trigger pushes new rows into the Added buffer. OnBatchSave receives Modified + Added when the user clicks Save all.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 5

Edit an entire row at once. Click the edit button to enter edit mode, then save or cancel.

Group by:

Expanded by default

Alice JohnsonEngineeringActive¤95,0002021-03-15
Bob SmithMarketingActive¤72,0002020-07-01
Carol WhiteEngineeringActive¤105,0002019-11-20
David BrownSalesInactive¤68,0002022-01-10
Eve DavisEngineeringActive¤98,0002020-05-05
Frank WilsonMarketingActive¤75,0002021-08-22
Grace LeeSalesActive¤82,0002019-06-30
Henry TaylorEngineeringActive¤110,0002018-09-12
Ivy MartinezMarketingInactive¤71,0002022-04-18
Jack AndersonSalesActive¤88,0002020-12-03
Avg: ¤87,083
Rows per page
1–10 of 12

Group rows by a field. Click the group header to expand or collapse each group. Set GroupsExpandedByDefault to control the initial state.

Group panel:

Levels:

Drag a Groupable column header here, or use the dropdown
Alice JohnsonEngineeringActive¤95,0002021-03-15
Bob SmithMarketingActive¤72,0002020-07-01
Carol WhiteEngineeringActive¤105,0002019-11-20
David BrownSalesInactive¤68,0002022-01-10
Eve DavisEngineeringActive¤98,0002020-05-05
Frank WilsonMarketingActive¤75,0002021-08-22
Grace LeeSalesActive¤82,0002019-06-30
Henry TaylorEngineeringActive¤110,0002018-09-12
Ivy MartinezMarketingInactive¤71,0002022-04-18
Jack AndersonSalesActive¤88,0002020-12-03
Avg: ¤87,083
Rows per page
1–10 of 12

Set ShowGroupPanel=&quot;true&quot; to render the chip-strip panel above the grid. Flag columns Groupable=&quot;true&quot; to make them addable. Use GroupByFields for ordered multi-level grouping — each level adds a nested row with its own aggregate.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Drag column headers to reorder them. Enable with the Reorderable property on the grid.

Alice JohnsonEngineering¤95,000
Active
Bob SmithMarketing¤72,000
Active
Carol WhiteEngineering¤105,000
Active
David BrownSales¤68,000
Inactive
Eve DavisEngineering¤98,000
Active
Rows per page
1–5 of 12

Apply dynamic CSS classes or inline styles to rows based on data. Useful for highlighting specific records.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Right-click a row to open a custom context menu with actions.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Save and restore column widths, order, visibility, sorts, filters, and the group panel (runtime group fields) to localStorage. The layout survives page refreshes. Use the Layouts dropdown in the toolbar to save named layouts under Personal, Global, or System Default scopes.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Pass GlobalLayouts to surface pre-built layouts in the Layouts dropdown. Users can also save their own Personal layouts which are stored in localStorage. The panel shows Personal / Global / System Default scopes.

Saving and loading layouts

For full control over where layouts are stored (your own database, a REST API, cookies, etc.), use the programmatic JSON API. Capture a grid reference with @ref, then call ExportLayout() to get a JSON string and ApplyLayoutJsonAsync(json) to round-trip it later. The snapshot covers column order, widths, visibility, pin state, sorts, filters, global search, current page, page size, and the group panel (multi-level group fields) — both single and multi-level grouping levels round-trip.

<DataGrid @ref="_grid" TItem="Order" Items="_orders">
    <DataGridColumnDef TItem="Order" Field="Id" Title="ID" />
    <DataGridColumnDef TItem="Order" Field="Customer" Title="Customer" />
    <DataGridColumnDef TItem="Order" Field="Total" Title="Total" Format="C2" />
</DataGrid>

<Button OnClick="SaveLayout">Save layout</Button>
<Button OnClick="LoadLayout">Load layout</Button>

@code {
    private DataGrid<Order>? _grid;
    [Inject] MyAppDbContext Db { get; set; } = default!;

    private async Task SaveLayout()
    {
        if (_grid is null) return;
        var json = _grid.ExportLayout();
        await Db.UserLayouts.AddAsync(new UserLayout {
            UserId = CurrentUserId,
            GridKey = "orders",
            Json = json,
            SavedAt = DateTime.UtcNow
        });
        await Db.SaveChangesAsync();
    }

    private async Task LoadLayout()
    {
        if (_grid is null) return;
        var latest = await Db.UserLayouts
            .Where(l => l.UserId == CurrentUserId && l.GridKey == "orders")
            .OrderByDescending(l => l.SavedAt)
            .FirstOrDefaultAsync();
        if (latest is not null)
            await _grid.ApplyLayoutJsonAsync(latest.Json);
    }
}

The JSON shape is the public DataGridLayoutSnapshot record. The snapshot is versioned (Version: 2 today) so future breaking changes can be migrated; v1 payloads still load — the legacy single-level GroupBy field is honoured as a fallback when GroupByFields is absent. Columns referenced in a snapshot that no longer exist on the grid are silently ignored; columns present on the grid but missing from the snapshot are appended at the end.

Reorder columns

Set Reorderable="true" on the grid to enable column reordering. Users can reorder columns two ways:

  • Drag-and-drop: grab a column header and drag it left or right. A 2px vertical drop indicator renders at the nearest column boundary to show where the column will land when released.
  • Keyboard / menu arrows: open the Toggle Columns popover from the toolbar and use the up/down arrow buttons next to each column. This path is the accessible fallback for users who can't use pointer drag-and-drop.

To pin an individual column so it cannot be reordered (for example, a required identifier column), set Reorderable="false" on that DataGridColumnDef. Both the drag handle and the menu arrows respect this flag.

<DataGrid TItem="Order" Items="_orders" Reorderable="true">
    <DataGridColumnDef TItem="Order" Field="Id" Title="ID" Reorderable="false" />
    <DataGridColumnDef TItem="Order" Field="Customer" Title="Customer" />
    <DataGridColumnDef TItem="Order" Field="Total" Title="Total" Format="C2" />
</DataGrid>
Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

The ToolbarContent component slots your custom buttons next to the toolbar's filter chips. Use the Class attribute to tweak the wrapper (gap, flex-wrap, etc.).

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Rows per page
1–5 of 12

Mix your own buttons with built-in tools. When you provide ToolbarContent, the default tool stack is suppressed — you pick exactly which tools to include and in what order. Each tool picks up the grid's state via a cascading context — no props needed.

Rows per page
0–0 of 0

For large datasets, use ServerMode to handle sorting, filtering, and pagination on the server. Sorting, filtering, search, and pagination all trigger OnServerRequest. Loading state and request cancellation are managed automatically.

Rows per page
0–0 of 0

Toggle the simulate error button to trigger a server failure. OnError receives the exception so you can display a message outside the grid.

EngineeringAlice Johnson¤95,0002021-03-15
MarketingBob Smith¤72,0002020-07-01
EngineeringCarol White¤105,0002019-11-20
SalesDavid Brown¤68,0002022-01-10
EngineeringEve Davis¤98,0002020-05-05
Rows per page
1–5 of 12

Click multiple column headers to sort by multiple fields. The grid applies sorts in the order they were added. Click a column again to cycle through ascending, descending, and unsorted.

Virtualization & large datasets

Lumeo's DataGrid supports two distinct strategies for large datasets — pick the one that matches where your data lives:

  • Client virtualization — items are already in memory. Set ShowPagination="false" and pass all rows; once the row count exceeds VirtualizeThreshold (default 500), Blazor's built-in <Virtualize> renders only the rows in the viewport. Tune VirtualItemSize if your rows are denser/taller than the 41 px default — an inaccurate value makes the scrollbar drift. Paged grids never trigger this path because they only render PageSize rows at a time.
  • Server-side paging — items live on a backend. Set ServerMode="true", handle OnServerRequest (Skip/Take/Sort/Filter), and report TotalCount. The grid shows numbered pages and the PageSizeOptions selector. Use this when you have many pages of data but only want to fetch one page at a time.
  • Virtualised server mode (infinite scroll) — the third mode. Set Virtualized="true" + provide an OnRangeRequest callback. The grid drops pagination, renders one tall scrollable body, and fetches a sliding window of rows from your backend as the user scrolls. Sort, column filters and global search all trigger an automatic refetch via Virtualize.RefreshDataAsync() — no manual wiring needed. Use this when you have hundreds of thousands of rows and want a grid that feels native, not paged.
No data available

Set Virtualized=true + provide OnRangeRequest. The grid fetches a sliding window of rows from your backend as the user scrolls, hides pagination, and re-fetches automatically when sort/filter/search change. Demo fakes a 50000-row backend with an in-memory list.

Alice JohnsonEngineering¤95,000Active
Bob SmithMarketing¤72,000Active
Carol WhiteEngineering¤105,000Active
David BrownSales¤68,000Inactive
Eve DavisEngineering¤98,000Active
Frank WilsonMarketing¤75,000Active
Grace LeeSales¤82,000Active
Henry TaylorEngineering¤110,000Active
Ivy MartinezMarketing¤71,000Inactive
Jack AndersonSales¤88,000Active
Rows per page
1–10 of 12

Pass a custom array to the rows-per-page selector — useful for grids with many rows where 100 isn't enough. Empty array hides the selector.

Alice JohnsonEngineering¤95,000Active2021-03-15
Bob SmithMarketing¤72,000Active2020-07-01
Carol WhiteEngineering¤105,000Active2019-11-20
David BrownSales¤68,000Inactive2022-01-10
Eve DavisEngineering¤98,000Active2020-05-05
Frank WilsonMarketing¤75,000Active2021-08-22
Grace LeeSales¤82,000Active2019-06-30
Henry TaylorEngineering¤110,000Active2018-09-12
Ivy MartinezMarketing¤71,000Inactive2022-04-18
Jack AndersonSales¤88,000Active2020-12-03
Kate ThomasEngineering¤102,000Active2021-02-14
Leo JacksonSales¤79,000Active2019-10-08

Set a fixed height on the grid to enable vertical scrolling for long lists.

Show skeleton rows while data is loading.

No employees found. Try adjusting your filters.

Rows per page
0–0 of 0

Custom content when the grid has no data.

Alice JohnsonEngineering¤95,000Active2021-03-15
Bob SmithMarketing¤72,000Active2020-07-01
Carol WhiteEngineering¤105,000Active2019-11-20
David BrownSales¤68,000Inactive2022-01-10
Eve DavisEngineering¤98,000Active2020-05-05
Rows per page
1–5 of 12

Enable the Expandable feature to add a fullscreen icon in the toolbar. Click it to pop the grid into a fullscreen modal overlay. Selection, filters, sorts, and pagination all survive the transition. Press Esc or click the close button to exit.

API Reference

DataGrid<TItem>

Property Type Default Description
ItemsIEnumerable<TItem>?--Data source for the grid.
ColumnsList<DataGridColumn<TItem>>?--Programmatic column definitions (alternative to DataGridColumnDef).
PageSizeint10Number of rows per page.
ShowPaginationbooltrueShow pagination controls.
ShowToolbarboolfalseShow toolbar with search, export, and column visibility.
ShowSearchbooltrueShow the global search box in the toolbar. Requires ShowToolbar.
ShowColumnChooserbooltrueShow the Columns (visibility/reorder) button in the toolbar.
ShowExportbooltrueShow the Export button and its format dropdown. Set false to hide export entirely; for per-format control see ExportFormats.
ExportFormatsDataGridExportFormatAllFlags enum controlling which formats appear in the Export dropdown. Combine with bitwise OR, e.g. DataGridExportFormat.Csv | DataGridExportFormat.Excel. When no flags are set the Export button is hidden.
SelectionModeDataGridSelectionModeNoneRow selection: None, Single, or Multiple.
EditModeDataGridEditModeNoneInline editing: None, Cell, Row, or Batch (buffered).
OnBatchSaveEventCallback<DataGridBatchSaveEventArgs<TItem>>--Fires when the user clicks "Save all" in EditMode=Batch. Carries Modified + Added rows. The grid's pending-changes buffer is cleared automatically on a clean return.
ShowAddRowboolfalseRenders a "+ Add row" trigger below the body in batch mode. Requires NewItemFactory.
NewItemFactoryFunc<TItem>?--Factory used by the "+ Add row" trigger. Each click produces a fresh row that lives in the batch buffer until OnBatchSave commits it.
HasPendingChangesbool (get)--True when the batch buffer contains a buffered edit or a new row. Bind via @ref for warn-on-navigate workflows.
BatchSaveAllText / BatchDiscardText / BatchAddRowTextstring?Save all / Discard / Add rowButton labels for the batch-mode toolbar. Override for localization.
ColumnVirtualizeboolfalseSimplified column virtualization — caps the number of horizontally-rendered data columns at MaxVisibleColumns. Pinned columns always render. Useful for very wide grids.
MaxVisibleColumnsint30Column cap used when ColumnVirtualize=true.
StripedboolfalseAlternate row background colors.
BorderedboolfalseShow cell borders.
CompactboolfalseSmaller row height and text.
HoverablebooltrueHighlight rows on hover.
Heightstring?--Fixed height with scrollable body (e.g., "400px").
ReorderableboolfalseEnable drag-and-drop column reordering.
RowReorderableboolfalseEnable drag-and-drop row reordering.
RowClassFunc<TItem, string>?--Function returning CSS class(es) for each row.
RowStyleFunc<TItem, string>?--Function returning inline style for each row.
PageSizeOptionsint[][10, 25, 50, 100]Page-size options shown in the rows-per-page selector. Pass new[] { 10, 50, 100, 200, 300 } for larger datasets, or an empty array to hide the selector entirely.
VirtualizeThresholdint500Row count above which Blazor's <Virtualize> kicks in. Only relevant when ShowPagination=false — paged grids never reach the threshold and never virtualize.
VirtualItemSizefloat41Estimated row height in CSS pixels. Tune if rows are denser/taller than the default.
VirtualOverscanCountint3Extra rows rendered above/below the viewport to hide pop-in during fast scrolling.
VirtualizedboolfalseEnables ItemsProvider-based infinite-scroll mode. Hides pagination and fetches a sliding row window via OnRangeRequest as the user scrolls. Sort/filter/search refresh the virtualizer automatically.
OnRangeRequestFunc<DataGridRangeRequest, ValueTask<DataGridRangeResponse<TItem>>>?--Range-fetch callback for virtualised server mode. Receives StartIndex, Count, current Sort/Filter/Search context; must return the slice plus current TotalCount.
ServerModeboolfalseEnable server-side sorting, filtering, and pagination.
TotalCountint0Total item count for server-side pagination.
IsLoadingboolfalseShow loading skeleton overlay.
EnableLayoutPersistenceboolfalseAuto-save/restore column layout to localStorage. Enables the Layouts dropdown in the toolbar.
LayoutStorageKeystring?autoCustom localStorage key for layout persistence.
SavedLayoutDataGridLayout?--Externally provided layout to apply on load.
GlobalLayoutsList<DataGridNamedLayout>?--Pre-built named layouts shown in the Global scope of the Layouts panel.
OnSaveNamedLayoutEventCallback<DataGridNamedLayout>--Fires when the user saves a named layout. Personal layouts are also persisted to localStorage automatically.
OnDeleteNamedLayoutEventCallback<string>--Fires when the user deletes a named layout. Receives the layout Id.
DetailTemplateRenderFragment<TItem>?--Template for expandable row details.
EmptyContentRenderFragment?--Custom content when no data.
<ToolbarContent>component--Nested component placed inside ChildContent. Takes Class for wrapper styling and ChildContent for custom buttons / built-in toolbar tools.
RowContextMenuRenderFragment<TItem>?--Right-click context menu template for rows.
OnRowClickEventCallback<TItem>--Callback when a row is clicked.
OnRowDoubleClickEventCallback<TItem>--Callback when a row is double-clicked.
OnCellEditEventCallback<CellEditEventArgs<TItem>>--Callback when a cell edit is committed.
OnRowEditEventCallback<RowEditEventArgs<TItem>>--Callback when a row edit is committed with all changed values.
OnColumnReorderEventCallback<ColumnReorderEventArgs>--Callback when columns are reordered via drag-and-drop.
OnRowReorderEventCallback<RowReorderEventArgs<TItem>>--Callback when rows are reordered via drag-and-drop.
OnLayoutSaveEventCallback<DataGridLayout>--Fires when the layout is saved (for external persistence).
SelectedItemsIReadOnlyList<TItem>?--Two-way bindable selected items collection.
SelectedItemsChangedEventCallback<IReadOnlyList<TItem>>--Callback when selection changes.
OnServerRequestEventCallback<DataGridServerRequest>--Server-side data request callback with sorts, filters, page info.
OnErrorEventCallback<Exception>--Fires when a server request throws an exception.
GroupBystring?--Single-level group field. Works in both client and ServerMode; use GroupByFields for multi-level.
ExpandableboolfalseAdds an expand icon to the toolbar for toggling fullscreen mode.
IsExpandedboolfalseTwo-way bindable fullscreen state. Set from code to programmatically expand/collapse.
IsExpandedChangedEventCallback<bool>--Fires whenever the fullscreen state toggles.
FullscreenTitlestring?--Optional title shown in the fullscreen header bar. Defaults to "Data Grid".
Classstring?--Additional CSS classes for the root element.
ExportLayout()stringmethodSerializes the current layout (column order, widths, visibility, pin state, sorts, filters, global search, page, page size, group-by) to a JSON string. Call via @ref.
ApplyLayoutJsonAsync(json)TaskmethodDeserializes a JSON layout produced by ExportLayout and applies it. Throws JsonException on malformed input; silently ignores columns that no longer exist.
GroupsExpandedByDefaultbooltrueInitial expand state for group headers when grouping is active.

ToolbarContent<TItem>

Place inside <ChildContent> of a DataGrid. Accepts custom buttons or built-in toolbar tool components (see below) that automatically pick up the grid's state via a cascading context.

Property Type Default Description
Classstring?--CSS classes applied to the wrapper around ChildContent + the toolbar's filter chips.
ChildContentRenderFragment?--Your custom buttons and any of the built-in toolbar tool components.

Toolbar Tool Components

Built-in tool components you can drop inside <ToolbarContent>. Each takes only TItem and reads everything else (selection, columns, export formats, layout config, Interop, Localizer) from a cascading DataGridToolbarContext<TItem>.

Component Renders Visible when
<DataGridToolbarFullscreen>Fullscreen toggle icon button.Expandable="true" on the grid.
<DataGridToolbarCopySelected>Copy-to-clipboard button (tab-separated, selected rows).At least one row is selected.
<DataGridToolbarColumns>Column visibility + reorder dropdown.Always (gate on the grid via ShowColumnChooser).
<DataGridToolbarExport>Export dropdown (CSV / Excel / PDF per ExportFormats).ExportFormats != None.
<DataGridToolbarLayouts>Saved-layouts panel (personal + global).EnableLayoutPersistence="true".

Omit <ToolbarContent> and all five tools auto-render in the default order (Fullscreen, CopySelected, Columns, Export, Layouts) gated by their Show* flags on the DataGrid. Provide <ToolbarContent> and the default stack is suppressed entirely — you pick which tools to include and where, no duplicates.

DataGridColumnDef<TItem>

Property Type Default Description
Titlestring?--Column header text.
Fieldstring?--Property name to bind to on TItem.
FieldSelectorFunc<TItem, object?>?--Custom value accessor (alternative to Field).
Widthdouble?--Column width in pixels.
MinWidthdouble?--Minimum column width in pixels during resize.
MaxWidthdouble?--Maximum column width in pixels during resize.
SortableboolfalseEnable sorting for this column.
FilterableboolfalseEnable filtering for this column.
ResizablebooltrueAllow column resizing via drag handle.
PinPinDirectionNonePin column: None, Left, or Right.
PinnableboolfalseWhether column can be pinned/unpinned via the UI.
GroupableboolfalseWhether column can be used for grouping.
ReorderablebooltrueWhether this column can be reordered (via header drag-and-drop or the Toggle Columns menu arrows). Set to false to pin an individual column's position even when the grid-level Reorderable is true.
FilterTypeDataGridFilterTypeTextFilter input type: Text, Number, Date, Select, Boolean.
FilterOptionsList<FilterOption>?--Options for Select filter type (label + value pairs).
OperatorsList<FilterOperator>?--Optional whitelist of operators to show in the filter UI for this column. When null, defaults for the FilterType are used.
FilterTemplateRenderFragment<DataGridFilterTemplateContext>?--Custom filter UI for this column. Replaces the built-in operator + value inputs when provided. Invoke the context's Apply callback with a FilterDescriptor to commit, or null to clear.
Formatstring?--Format string (e.g., "C0", "yyyy-MM-dd", "N2").
AggregateAggregateTypeNoneFooter aggregate: None, Sum, Average, Count, Min, Max.
CustomSortComparison<object?>?--Custom sort comparison function for this column.
CellClassFunc<TItem, string>?--Function returning dynamic CSS class(es) for each cell.
HeaderCssClassstring?--Custom CSS class for the header cell.
CellTemplateRenderFragment<TItem>?--Custom render template for cell content.
HeaderTemplateRenderFragment?--Custom render template for header.
EditTemplateRenderFragment<CellEditContext<TItem>>?--Custom template for inline editing input.

Event Args

Type Properties Description
CellEditEventArgs<TItem>Item, Field, OldValue, NewValueFired when a cell edit is committed.
RowEditEventArgs<TItem>Item, ChangedValuesFired when a row edit is committed. ChangedValues is a Dictionary<string, object?>.
ColumnReorderEventArgsColumnId, OldIndex, NewIndexFired when a column is drag-reordered.
RowReorderEventArgs<TItem>Item, OldIndex, NewIndexFired when a row is drag-reordered.
DataGridServerRequestPage, PageSize, Sorts?, Filters?, GlobalSearch?, GroupBy?, CancellationTokenSent to OnServerRequest with current grid state. GroupBy contains the current group field if set. CancellationToken should be passed to your HTTP client to abort superseded requests.
DataGridLayoutColumns, Sorts?, Filters?, PageSize?, GlobalSearch?Serializable layout snapshot for persistence.
DataGridNamedLayoutId, Name, Scope, LayoutA named layout entry. Scope is "Personal", "Global", or "SystemDefault".
DataGridLayoutSnapshotVersion, Columns, Sorts, Filters, GlobalSearch?, CurrentPage, PageSize, GroupBy?Public, JSON-serializable shape used by ExportLayout/ApplyLayoutJsonAsync. Version is bumped on schema changes.
DataGridColumnLayoutField, Order, Visible, Width?, Pin?Per-column entry inside a DataGridLayoutSnapshot.

Enums

DataGridSelectionMode
NoneNo selection.
SingleSelect one row at a time.
MultipleSelect multiple rows with checkboxes.
PinDirection
NoneColumn scrolls normally.
LeftSticky to left edge.
RightSticky to right edge.
DataGridEditMode
NoneNo editing.
CellClick a cell to edit inline.
RowEdit entire row at once.
AggregateType
NoneNo aggregation.
SumSum of numeric values.
AverageAverage of numeric values.
CountCount of non-null values.
MinMinimum value.
MaxMaximum value.

DataGridFilterType

Value Description
TextText filter with contains, starts with, equals operators.
NumberNumeric filter with comparison and between operators.
DateDate filter with date picker and comparison operators.
SelectMulti-select checkbox filter from predefined options.
BooleanTrue/false toggle filter.

Tree-grid mode (hierarchical rows)

Set ChildItemsSelector to a function that returns a row's children (null/empty for leaves) and the grid renders a recursive tree-grid: the first visible column gets an expand/collapse chevron indented by depth, the <table> uses role="treegrid", and expandable rows carry aria-expanded / aria-level. Sorting, filtering and paging apply to the root items; a paged-in root shows its whole expanded subtree. Tree-grid mode and DetailTemplate master-detail are mutually exclusive — tree mode wins.

ParameterTypeDescription
ChildItemsSelectorFunc<TItem, IEnumerable<TItem>?>?When set, enables tree-grid mode; returns a row's child rows.
TreeGridDefaultExpandedboolWhether tree nodes start expanded. Default false.
TreeColumnFieldstring?Field of the column carrying the chevron + indentation. Null = first visible column.
OnTreeNodeExpandEventCallback<TItem>Raised when a tree node is expanded or collapsed.

Group panel & multi-level grouping

Set ShowGroupPanel="true" to render a strip above the grid listing the active grouping levels as removable chips, plus an "add level" dropdown of every column flagged Groupable. Use GroupByFields (an ordered list of column fields) for nested multi-level grouping — the grid renders nested group rows with increasing indentation and a per-group aggregate row (the same Column.Aggregate values as the grand-total footer, computed over each group). A single-element list (or the legacy GroupBy string) keeps the classic single-level grouping.

Works in ServerMode too. Both single-level GroupBy and multi-level GroupByFields are applied client-side to whatever rows the server returned, and the runtime panel handlers (drag-to-add, add-level dropdown, per-chip remove, clear-all) trigger an in-place regroup without an extra server round-trip. Grouping operates over the current page only — for cross-page grouping, either disable pagination (ShowPagination="false") so the server delivers all rows in one response, or have the server pre-aggregate groups itself.

ParameterTypeDescription
ShowGroupPanelboolShows the grouping chip strip + add-level dropdown. Default false.
GroupByFieldsIReadOnlyList<string>?Ordered column fields for multi-level grouping; takes precedence over GroupBy. Works in both client and ServerMode (grouping runs over the rows the server returned for the current page).
GroupPanelTextstring?Placeholder hint shown in the panel when nothing is grouped.
Column.GroupableboolGates whether a column can be added to the group panel.
  • DataTable — A simpler table component for basic tabular data without advanced grid features
  • Table — Low-level table building blocks for fully custom table layouts
  • Pagination — Standalone pagination control for navigating through paged data