Skip to content
IzzyBlazor 0.1.0-alpha.20

Enter all results ↑ ↓ move Esc close

DataGrid

Since 0.1.0-alpha.20
Edit, group, filter by row and arrange columns, with state in the URL.

IzzyBlazor.DataGrid<TItem> in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.20 assembly and its doc comments.

Properties (82)

DetailTemplateRenderFragment<TItem>?Added in 0.1.0-alpha.20

A row's detail: drawn under it, across the grid, while it's open. Setting it adds a column of buttons that open and close it. It needs an ItemKey, which open rows are kept by. Only open rows draw it, so a component in it loads its own data when it's opened.

ItemHasDetailFunc<TItem, bool>?Added in 0.1.0-alpha.20

Which rows have a detail; all of them when it's not set. A row without one has no button, except while the grid hides columns to fit, when its detail shows their values.

@bind-OpenDetailsIReadOnlyList<string>?Added in 0.1.0-alpha.20 @bind: Interactive only

Which rows' details are open, by key; "*" is all of them, and "!key" an exception to that. Binding it on an interactive page keeps it in the component; otherwise it's in the address.

DetailsOpenbool = falseAdded in 0.1.0-alpha.20

Whether every row's detail starts open.

SingleDetailbool = falseAdded in 0.1.0-alpha.20

Opening a row's detail closes the one that was open. There's no button to open them all.

Groupablebool = falseAdded in 0.1.0-alpha.20

Lets people group by columns, from a header's menu. Grouped, the grid's pages count top-level groups, so a group is never split, and each group's count and aggregates are the whole group's. With an ItemsProvider, it needs a GroupsProvider.

@bind-Groupstring?Added in 0.1.0-alpha.20 @bind: Interactive only

The grouping, outermost first, such as "status,-customer" (- for descending); null for InitialGroup. Works without Groupable, for a grouping people can't change. Binding it (@bind-Group) on an interactive page keeps it in the component instead of the URL.

InitialGroupstring?Added in 0.1.0-alpha.20

The grouping when the URL has none, such as "status".

GroupsOpenbool = falseAdded in 0.1.0-alpha.20

Whether groups start open. They start closed by default, which is what a page of groups is for.

@bind-OpenGroupsIReadOnlyList<string>?Added in 0.1.0-alpha.20 @bind: Interactive only

Which groups are open, each by its values joined with /, escaped, such as "Shipped/Acme"; "*" is all of them, and "!Shipped" an exception to that. Binding it on an interactive page keeps it in the component.

GroupRowLimitint = 100Added in 0.1.0-alpha.20

The most rows drawn in one open group. Past it, the group says how many it has and links to showing only that group, with the grid's pages. Defaults to 100.

GroupPanelbool = falseAdded in 0.1.0-alpha.20

Keeps the bar of what's grouped above the grid while nothing is, saying a header can be dragged there. Without it the bar shows only while grouped, and the first grouping is from a header's menu. Dragging needs script and a mouse or pen; the menu works everywhere.

Without JavaScript: With JavaScript off, the bar shows what's grouped, and headers can't be dragged to it.

ShowGroupedColumnsbool = falseAdded in 0.1.0-alpha.20

Keeps a grouped column in the table. By default it leaves, as each group's row says its value.

SmallScreenDataGridSmallScreen = DataGridSmallScreen.ScrollAdded in 0.1.0-alpha.20

What it does when its columns don't fit its width: DataGridSmallScreen.Scroll (the default) scrolls sideways; DataGridSmallScreen.HideColumns hides columns by their Priority and shows their values in the row's detail. Hiding needs an ItemKey, can't be used with Virtualize, and makes the grid as wide as its space. A hidden column's header is hidden with it, so sort or filter it from the column picker or the filter chips. Widths dragged by ResizableColumns count from the next time the server draws the grid.

Noncestring? (computed)Added in 0.1.0-alpha.20

A CSP nonce for the style element that holds the widths where columns hide. Defaults to the IzzyTheme's Nonce on the page; set it on interactive pages, which don't see the theme's.

EditModeDataGridEditMode = DataGridEditMode.NoneAdded in 0.1.0-alpha.20

How a row is edited. Needs OnSave and an ItemKey.

FindItemFunc<string, Task<TItem>>?Added in 0.1.0-alpha.20

Finds a row that isn't among those loaded, by its key, for the edit dialog and the delete confirmation: a link to a row on another page, say. A grid that loads rows as they're needed (Virtualize, or Paging by loading more) has to have it. Return null for a row this person can't reach: ItemEditable and ItemDeletable are checked on what it returns.

NewItemFunc<TItem>?Added in 0.1.0-alpha.20

A new row's starting values. Setting it adds an Add button to the toolbar, and OnSave gets the row with IsNew set.

ItemEditableFunc<TItem, bool>?Added in 0.1.0-alpha.20

Which rows can be edited; all of them when it's not set. It's checked on a save too, not just when drawing the button.

ItemDeletableFunc<TItem, bool>?Added in 0.1.0-alpha.20

Which rows can be deleted; all of them when it's not set. It's checked on a delete too, not just when drawing the button.

@bind-EditKeystring?Added in 0.1.0-alpha.20 @bind: Interactive only

The key of the row being edited, or null. Binding it (@bind-EditKey) on an interactive page keeps it, with sort and page, in the component. Otherwise it's in the address (?edit=42), or where another of them is bound, such as Page, kept in the component.

EditCopyFunc<TItem, TItem>?Added in 0.1.0-alpha.20

Makes the copy of a row that's edited, on an interactive page, in place of a shallow copy: for a type that holds what a copy mustn't share.

LayoutKeystring?Added in 0.1.0-alpha.20

Remembers how each person has arranged the columns, in a cookie under this name, so the server draws it on the first paint. Letters, digits, - and _. With neither this nor Layout, nothing is stored.

@bind-LayoutDataGridLayout?Added in 0.1.0-alpha.20 @bind: Interactive only

How the columns are arranged, in place of the cookie: bind it (@bind-Layout) to keep layouts yourself, such as per user in a database. Null leaves them as declared.

LayoutSaveUrlstring?Added in 0.1.0-alpha.20

With script, an address the app maps to save a person's layout: the grid posts it there as JSON when it changes, for a static page that passes its own Layout.

ResizableColumnsbool = falseAdded in 0.1.0-alpha.20

Lets people resize columns: by dragging a handle at the header's end, by double-clicking it to fit, by Shift+Left and Shift+Right, or from the header's menu. The grid scrolls if it grows. Needs script, and on a static page a LayoutKey or LayoutSaveUrl.

ReorderableColumnsbool = falseAdded in 0.1.0-alpha.20

Lets people move columns: by dragging a header, by Alt+Left and Alt+Right, or from the header's menu, which can also freeze them. Frozen columns move among themselves. Needs script, and on a static page a LayoutKey or LayoutSaveUrl.

ColumnPickerbool = falseAdded in 0.1.0-alpha.20

A button above the grid listing the columns to show or hide, and to put back as declared. Needs script, and on a static page a LayoutKey or LayoutSaveUrl.

Virtualizebool = falseAdded in 0.1.0-alpha.20

Draws only the rows in view, on an interactive page; on a static page they load on scroll instead, by PageSize (50 if not set), up to 2,000 rows. Needs a MaxHeight, and rows of one line, as tall as RowHeight. An ItemsProvider must return a Total, and read each window's Skip and Take, not Page, as a window needn't start on a page. It can't take paging by cursor. Pages, and their footer, don't apply.

RowHeightdouble = 48Added in 0.1.0-alpha.20

The height of every row, in pixels, with Virtualize. Text past it is cut short. A control in a cell can't be cut short: a row with a checkbox or a ⋮ button needs at least 33. Defaults to 48.

ToolbarLabelsbool = falseAdded in 0.1.0-alpha.20

Text beside the icons of the toolbar's own tools, for a grid people use now and then. Without it they're icons with a tooltip, for one used all day. A tool's own ShowText goes first.

ExportCsvHrefstring?Added in 0.1.0-alpha.20

A link in the toolbar, in a menu with ExportExcelHref, to an endpoint that writes the rows as CSV with DataExport, for a grid that offers CSV besides Excel. It adds the current filter, sort, search and columns to the address. The endpoint's fields need the grid's keys, and its FilterCase as their Case, for the file to match the screen.

ExportExcelHrefstring?Added in 0.1.0-alpha.20

A link in the toolbar, in a menu with ExportCsvHref, to an endpoint that writes the rows as an Excel workbook with DataExport. It adds the current filter, sort, search and columns to the address. The endpoint's fields need the grid's keys, and its FilterCase as their Case, for the file to match the screen.

ToolbarContentRenderFragment?Added in 0.1.0-alpha.20

The page's own controls in the toolbar above the grid: ToolbarButton, ToolbarMenu and the like. Write DataGridSearch, DataGridExport or DataGridColumnPicker here to place the grid's own among them. While rows are selected, the selection bar takes its place. The grid reads this once more on each render, to see which of its tools are here, so nothing in it should count or consume anything.

Searchablebool = falseAdded in 0.1.0-alpha.20

A search box in the toolbar, across the text columns. The words go in the address (?search=) and reach an ItemsProvider as the request's Search. With no script they apply on Enter.

SearchLabelstring? = "Search"Added in 0.1.0-alpha.20

The search box's name and placeholder. Defaults to "Search".

FilterRowbool = falseAdded in 0.1.0-alpha.20

Adds a row of filters under the titles: a field for each column, then its filter button, which opens the column's panel, where the operator is chosen. A list, a range or a date shows what it's set to, and opens the panel too.

FilterBuilderbool = falseAdded in 0.1.0-alpha.20

Adds a Filter builder button to the toolbar, for groups of conditions no column's filter can hold. What it builds goes in the address as ?filter=, and applies along with the columns' filters.

Without JavaScript: With JavaScript off the button is hidden. A filter already in the address still applies.

GroupsProviderFunc<DataGroupRequest<TItem>, ValueTask<DataGroupResult>>?Added in 0.1.0-alpha.20

Counts and aggregates for an ItemsProvider, which a column's Aggregate needs. It gets one request for each level of groups, and one with no keys for the grand total. Answer it from a query with request.ToResultAsync. With Items, the grid works these out itself.

ChildContentRenderFragment?Added in 0.1.0-alpha.20
InitialSortstring?Added in 0.1.0-alpha.20

The sort when the URL has none, such as "name" or "-date" (descending). A DataGrid takes several: "status,-date".

@bind-Sortstring?Added in 0.1.0-alpha.20 @bind: Interactive only

The sort, such as "name" or "-date" (descending), or several in a DataGrid ("status,-date"); null for InitialSort. Binding it (@bind-Sort) on an interactive page keeps sort and page in the component instead of the URL.

@bind-FilterFilter?Added in 0.1.0-alpha.20 @bind: Interactive only

The filter: Filter.All of a condition per filtered column (contains for text, between for numbers, equals for dates, equals or in for choices), or null for none. Binding it (@bind-Filter) on an interactive page keeps filters, sort and page in the component instead of the URL. Set it in C#, such as Filter.Where("status", FilterOperator.Equals, "Paid"); a condition no column's panel can show still applies, and shows as a tag that removes it.

FilterCaseFilterCase = FilterCase.IgnoreCaseAdded in 0.1.0-alpha.20

How text compares in the column filters and search. Defaults to FilterCase.IgnoreCase, which lowers both sides. FilterCase.Database compares text as it is and leaves it to the database's collation, so an index can serve it. An export endpoint sets Case on its own fields, or the file and the screen can differ.

FilterPanelbool = falseAdded in 0.1.0-alpha.20

A row below the rows that lists the active filters, each with a button to remove it, and Clear for all of them. It's there whether or not anything is filtered, so nothing moves.

Captionstring?Added in 0.1.0-alpha.20

The table's name for screen readers (a visually hidden caption).

RowClassFunc<TItem, string?>?Added in 0.1.0-alpha.20

A class for each row, such as one that highlights overdue orders.

RowHoverbool = falseAdded in 0.1.0-alpha.20

Highlights the row under the pointer, to help follow a wide one across. Defaults to false, as a highlight suggests a row does something. A row with a RowHref always has it, and a row being edited never does.

Stripedbool = falseAdded in 0.1.0-alpha.20

Alternating row backgrounds.

RowLinesbool = trueAdded in 0.1.0-alpha.20

A line between rows. Defaults to true; the line under the header always shows.

ColumnLinesbool = falseAdded in 0.1.0-alpha.20

A line between columns. Defaults to false.

ShadedHeaderbool = falseAdded in 0.1.0-alpha.20

Shades the header, and a DataGrid's FilterRow with it, so they read apart from the rows; its color is --ib-table-head-bg. Defaults to false. With Striped too, the header is a little lighter than a stripe.

Borderedbool = trueAdded in 0.1.0-alpha.20

A rounded border around the table. Defaults to true; false for a table that sits inside a card or panel.

SizeControlSize = ControlSize.MdAdded in 0.1.0-alpha.20

Row height and text size. ControlSize.Sm for dense data. Defaults to ControlSize.Md.

MaxHeightLength?Added in 0.1.0-alpha.20

A height limit: the rows scroll and the header stays in view.

RowHrefFunc<TItem, string?>?Added in 0.1.0-alpha.20

Makes each row a link, such as to the item's details page. The whole row is clickable; links, buttons and checkboxes inside it still work on their own.

RowCurrentFunc<TItem, bool>?Added in 0.1.0-alpha.20

The row for what the page is showing, such as the one whose details are in a panel beside the table: drawn as selected, and marked aria-current (on its link with RowHref).

RowLabelFunc<TItem, string>? (computed)Added in 0.1.0-alpha.20

Names a row for screen readers, in its link and its checkbox. Defaults to ItemKey.

FilterFromAddressbool = falseAdded in 0.1.0-alpha.20

Applies a whole filter from the address (?filter=, with the QueryPrefix), as a FilterBuilder<T> on the page writes it, along with the columns' own. Off by default, as the page may use that name itself.

ItemsIEnumerable<TItem>?Added in 0.1.0-alpha.20

The items. A list is paged in memory; an IQueryable (such as an EF Core query) is paged by the database.

ItemsProviderFunc<DataRequest<TItem>, ValueTask<DataResult<TItem>>>?Added in 0.1.0-alpha.20

Loads the items yourself, in place of Items: the request has the range (and in a Table the sort, the filter and the columns as fields), so request.ToResultAsync(query, ...) or request.Apply(query) does the work. An exception it throws shows "Couldn't load the rows." with Retry (and is logged); a request that was canceled is ignored.

@bind-PageSizeint?Added in 0.1.0-alpha.20 @bind: Interactive only

Items per page. Leave it out to show every item.

PageSizeOptionsIReadOnlyList<int>?Added in 0.1.0-alpha.20

Sizes to choose from in a "Rows per page" menu in the footer, such as new[] { 10, 25, 50 }. The URL carries the choice (?size=25); only these sizes are accepted from it. PageSize is the default (the first option when not set).

@bind-Pageint?Added in 0.1.0-alpha.20 @bind: Interactive only

The page, from 1. Binding it (@bind-Page) on an interactive page keeps it in the component instead of the URL. Set it back to 1 when your filters change.

PagingDataPaging = DataPaging.PagesAdded in 0.1.0-alpha.20

How it moves through its pages when it has a PageSize: numbered pages (DataPaging.Pages, the default, which needs a total), or by cursor, with no total needed: First, Previous and Next (DataPaging.NextPrevious), a "Load more" button after the items (DataPaging.LoadMore, ListView only), or loading as the last item comes into view (DataPaging.LoadOnScroll).

Without JavaScript: With JavaScript off, LoadOnScroll doesn't load as you scroll: its Load more button shows, which reloads the page with one more page.

LoadMoreTextstring? = "Load more"Added in 0.1.0-alpha.20

The "Load more" button's text, such as "Load earlier". Defaults to "Load more".

@bind-Cursorstring?Added in 0.1.0-alpha.20 @bind: Interactive only

The cursor of the page shown when paging by cursor (Paging); null for the first page. Binding it (@bind-Cursor) on an interactive page keeps it in the component instead of the URL; Page is then the page's position.

QueryPrefixstring = ""Added in 0.1.0-alpha.20

Prefix for its query-string keys, so several can share a page: QueryPrefix="orders-" uses ?orders-page= (and a Table's ?orders-sort=).

EmptyContentRenderFragment? (computed)Added in 0.1.0-alpha.20

Shown when there are no items. Defaults to EmptyText.

EmptyTextstring? = "No items"Added in 0.1.0-alpha.20

The text when there are no items. Defaults to "No items".

ErrorContentRenderFragment?Added in 0.1.0-alpha.20

Shown in place of "Couldn't load the rows." when loading fails, before the Retry button.

ItemKeyFunc<TItem, string>? (computed)Added in 0.1.0-alpha.20

A unique, stable key for each item, such as its id. Selection posts and binds these keys. Defaults to the item's string form.

Loadingbool = falseAdded in 0.1.0-alpha.20

Shows it as loading: items dim, or placeholders show while there are none. Set automatically while an ItemsProvider loads on interactive pages.

SelectionModeSelectionMode = SelectionMode.NoneAdded in 0.1.0-alpha.20

Whether items can be selected: one (a radio button on each) or several (a checkbox on each). Inside a form, the selected items post their ItemKey under SelectionName; bind Selection to follow them.

SelectionNamestring? (computed)Added in 0.1.0-alpha.20

The form field name the selection posts under, read back as a Selection with [SupplyParameterFromForm(Name = ...)]. Defaults to "{QueryPrefix}selected": give two selectable views in one form a QueryPrefix (or a name) each.

@bind-SelectionSelection?Added in 0.1.0-alpha.20 @bind: Interactive only

The selected items: keys on any page, or every item matching the filter except some. On a static page pass back the posted one. Selecting all that match is cleared when the filter or search changes.

ItemSelectableFunc<TItem, bool>?Added in 0.1.0-alpha.20

Whether an item can be selected; others show a disabled, unchecked box, and selecting the page or a range leaves them out. "Select all" (every matching item) can't know this rule: leave them out of the query you apply the Selection to.

SelectAllModeSelectAllMode = SelectAllMode.PageAdded in 0.1.0-alpha.20

What the select-all checkbox selects: the items on this page, or every item the filters match, on any page. Those aren't loaded, so act on them with Selection.Apply. With virtual rows, SelectAllMode.Page reaches only the rows drawn.

SelectionActionsRenderFragment<Selection>?Added in 0.1.0-alpha.20

Actions on the selection, in a bar above the items, disabled until something is selected (on a DataGrid with a toolbar, the bar takes the toolbar's place while something is). Submit buttons in the surrounding form post the selection. A link can't be disabled, so it stays live. Without these there's no bar.

SelectAllLabelstring? = "Select all rows"Added in 0.1.0-alpha.20

The select-all checkbox's name for screen readers. Defaults to "Select all rows".

SelectRowLabelstring? = "Select"Added in 0.1.0-alpha.20

The start of each item checkbox's name for screen readers, before the item's label. Defaults to "Select".

Events (2)

OnSaveEventCallback<DataGridSave<TItem>>Added in 0.1.0-alpha.20

Saves an edited row. With no errors added, the editor closes and the rows load again; with errors, it stays open and shows them. It's called only when the row is valid by its rules.

OnDeleteEventCallback<DataGridDelete<TItem>>Added in 0.1.0-alpha.20

Deletes a row, once someone has confirmed it. Setting it adds a Delete action to each row. With no error added, the dialog closes and the rows load again.

Methods (1)

ReloadAsyncAdded in 0.1.0-alpha.20
Task ReloadAsync()

Loads the items again, such as after an edit. With DataPaging.LoadMore it starts over from the page the list began at, dropping the pages added since.

Parts (12)

Components written inside DataGrid, documented here with it.

ActionColumn<TItem>

The column that holds a row's actions, at the end of a DataGrid. A grid with editing has one by itself, with Edit and Delete; write one to set their order, or to add your own actions.

ChildContentRenderFragment<TItem>?Added in 0.1.0-alpha.20

The row's actions: EditAction, DeleteAction and RowAction. context is the row.

OverflowRowActionOverflow = RowActionOverflow.AutoAdded in 0.1.0-alpha.20

Where its actions show, unless one says otherwise. RowActionOverflow.Always makes it a ⋮ menu. The default, RowActionOverflow.Auto, is buttons, which move into the menu once the grid hides columns to fit (DataGridSmallScreen.HideColumns).

RowAction

An action of your own on a row: an icon button with a tooltip, or an item in its menu.

IconIconData?Added in 0.1.0-alpha.20

Its icon.

Labelstring requiredAdded in 0.1.0-alpha.20

What it does: the button's name and tooltip, or the item's text. Say which row, if it isn't clear from a list of them.

Hrefstring?Added in 0.1.0-alpha.20

Makes it a link.

Namestring?Added in 0.1.0-alpha.20

The form field name the button posts under, with Value, and Form as the table can't hold a form of its own.

Valuestring?Added in 0.1.0-alpha.20

The value the button posts.

Formstring?Added in 0.1.0-alpha.20

The id of the form it submits. Setting it makes it a submit button.

Disabledbool = falseAdded in 0.1.0-alpha.20

Whether it can't be used.

Visiblebool = trueAdded in 0.1.0-alpha.20

Whether this row has it.

OverflowRowActionOverflow? (computed)Added in 0.1.0-alpha.20

Where it shows. Defaults to the column's Overflow.

OnClickEventCallbackAdded in 0.1.0-alpha.20Interactive only

Runs when it's used, on interactive pages.

EditAction

The row's edit action: a pencil, or an item in its menu. Drawn only where the row can be edited.

DisabledReasonstring?Added in 0.1.0-alpha.20

Where ItemEditable says no, the action stays, disabled, with this as its tooltip, in place of leaving a gap. The reason can depend on the row.

Visiblebool = trueAdded in 0.1.0-alpha.20

Whether this row has it.

OverflowRowActionOverflow? (computed)Added in 0.1.0-alpha.20

Where it shows. Defaults to the column's Overflow.

DeleteAction

The row's delete action, which asks first: a trash can, or an item in its menu. Drawn only where the row can be deleted.

DisabledReasonstring?Added in 0.1.0-alpha.20

Where ItemDeletable says no, the action stays, disabled, with this as its tooltip, in place of leaving a gap. The reason can depend on the row.

Visiblebool = trueAdded in 0.1.0-alpha.20

Whether this row has it.

OverflowRowActionOverflow? (computed)Added in 0.1.0-alpha.20

Where it shows. Defaults to the column's Overflow.

EditLayout<TItem>

Sets up a DataGrid's generated edit dialog. Its parameters are the dialog's and the form's, as Form names them. Inside it, an EditField for a column sets its place and its label, hint or span, and the library's components can go around them. The grid still draws, binds and checks each field. An editable column left out is added at the end, as a field that isn't drawn isn't posted, and would save as empty; to leave one out, set its Editable to false.

ChildContentRenderFragment?Added in 0.1.0-alpha.20

The fields, and whatever goes around them.

Columnsint = 1Added in 0.1.0-alpha.20

The columns the fields are laid out in, as Form's Columns. Defaults to 1.

LayoutFormLayout = FormLayout.VerticalAdded in 0.1.0-alpha.20

How labels sit next to fields, as Form's Layout.

SizeDialogSize = DialogSize.MdAdded in 0.1.0-alpha.20

The dialog's size.

TitleFunc<TItem, string>? (computed)Added in 0.1.0-alpha.20

The dialog's title, from the row, which is the default for a new one. Defaults to "Edit" and the row's label.

EditField

A column's generated field, placed in an EditLayout<T>.

Keystring requiredAdded in 0.1.0-alpha.20

The column's key: its SortKey, or its property's name in lower case, as in the address.

Labelstring?Added in 0.1.0-alpha.20

The field's label, if not the column's title.

Hintstring?Added in 0.1.0-alpha.20

The field's hint.

ColSpanResponsive<int>ResponsiveAdded in 0.1.0-alpha.20

The columns of the form the field spans, such as 2 or GridSpan.Full.

EditFormTemplate<TItem>

Your own form in a DataGrid's edit dialog, in place of the generated one, for what isn't fields of the row, such as steps or a save across several records. The grid opens and closes the dialog; the form, its model and its [SupplyParameterFromForm] are yours, and on a static page, so is guarding against forged fields, with a view model.

ChildContentRenderFragment<DataGridEditFormContext<TItem>>?Added in 0.1.0-alpha.20

The form. Call context.CloseAsync() when it has saved.

SizeDialogSize = DialogSize.MdAdded in 0.1.0-alpha.20

The dialog's size.

TitleFunc<TItem, string>? (computed)Added in 0.1.0-alpha.20

The dialog's title, from the row, which is the default for a new one. Defaults to "Edit" and the row's label.

DataGridAdd

Puts a DataGrid's Add button, from NewItem, among your toolbar items. It stays in the bar, at the end unless Position says otherwise.

ShowTextbool? (computed)Added in 0.1.0-alpha.20

Its text beside its icon, or only its icon. Defaults to the grid's ToolbarLabels.

PositionToolbarPosition = ToolbarPosition.EndAdded in 0.1.0-alpha.20

Where it sits, among the items of that position in the order they're written.

DataGridSearch

Puts a DataGrid's search box, from Searchable, among your toolbar items. It stays in the bar, as a box.

PositionToolbarPosition = ToolbarPosition.StartAdded in 0.1.0-alpha.20

Where it sits, among the items of that position in the order they're written.

DataGridExport

Puts a DataGrid's export, from ExportExcelHref and ExportCsvHref, among your toolbar items: a link with one of them, or with both a button with a chevron that opens a menu of links. At the end unless Position says otherwise.

Priorityint = 0Added in 0.1.0-alpha.20

Which items stay longest when there's no room: higher stays longer. Defaults to 0.

OverflowToolbarOverflow = ToolbarOverflow.AutoAdded in 0.1.0-alpha.20

When it moves into the "…" menu. Defaults to ToolbarOverflow.Auto.

ShowTextbool? (computed)Added in 0.1.0-alpha.20

Its text beside its icon, or only its icon. Defaults to the grid's ToolbarLabels.

PositionToolbarPosition = ToolbarPosition.EndAdded in 0.1.0-alpha.20

Where it sits, among the items of that position in the order they're written.

DataGridFilterBuilder

Puts a DataGrid's Filter builder button, from FilterBuilder, among your toolbar items. It stays in the bar, at the start unless Position says otherwise.

ShowTextbool? (computed)Added in 0.1.0-alpha.20

Its text beside its icon, or only its icon. Defaults to the grid's ToolbarLabels.

PositionToolbarPosition = ToolbarPosition.StartAdded in 0.1.0-alpha.20

Where it sits, among the items of that position in the order they're written.

DataGridColumnPicker

Puts a DataGrid's Columns button, from ColumnPicker, among your toolbar items. It stays in the bar, at the end unless Position says otherwise.

ShowTextbool? (computed)Added in 0.1.0-alpha.20

Its text beside its icon, or only its icon. Defaults to the grid's ToolbarLabels.

PositionToolbarPosition = ToolbarPosition.EndAdded in 0.1.0-alpha.20

Where it sits, among the items of that position in the order they're written.

Types (23)

ControlSize

enum

The height of interactive controls. Shared by buttons and form fields, so a button and an input of the same size line up in a row.

ControlSize values
ValueDescription
Sm

32px tall, small text.

Md

36px tall (the default).

Lg

44px tall, large text. For touch-first and marketing pages.

DataGridDelete

class

A delete from a DataGrid, for its OnDelete. With no error added, the dialog closes and the rows load again.

DataGridDelete members
MemberDescription
Item TItem

The row to delete.

AddError(string message)

Reports why it can't be deleted, shown in the dialog, which stays open.

DataGridEditFormContext

class

What a EditFormTemplate<T> gets.

DataGridEditFormContext members
MemberDescription
Item TItem

The row as loaded, which isn't a copy, or the default for a new one.

IsNew bool

Whether it's a new row.

Cancel RenderFragment

The Cancel button, for your DialogFooter.

CloseAsync()

Closes the dialog and loads the rows again, once your form has saved.

DataGridEditMode

enum

How a DataGrid edits a row.

DataGridEditMode values
ValueDescription
None

It doesn't. The default.

Dialog

In a dialog, with a field for each editable column.

Row

In the row, with a field in each editable column that's shown. A new row starts at the top of the page. Not with rows that load as they're needed, which could scroll it away.

Cell

One cell at a time, on an interactive page: a click, Enter, F2 or typing starts it, and Tab, Enter or a click elsewhere saves it. OnSave runs for each cell that changed. A new row is edited as in DataGridEditMode.Row, and so is every row on a static page, where a round trip for each cell would make moving through them unusable.

DataGridLayout

record

How one person has arranged a DataGrid's columns: only what differs from the columns as declared. Serializable, to keep per user in a database. Sort, filter and page aren't part of it: they're in the address, so one link shows the same rows to everyone.

DataGridLayout members
MemberDescription
Parse(string? json)

A layout from ToJson, or null if it isn't one. It may come from a cookie, so whatever doesn't hold up is left out: a width that isn't plain pixels or rems, an unknown frozen side, a column past the limit.

Columns IReadOnlyList<DataGridColumnLayout>

The columns that differ from their declaration.

Column(string key)

A column's entry, by its key (its SortKey or property, else its title), or null.

ToJson()

The layout as JSON, as a cookie holds it.

DataGridSave

class

A save from a DataGrid, for its OnSave. With no errors added, the editor closes and the rows load again. With errors, it stays open and shows them.

DataGridSave members
MemberDescription
Item TItem

The row with its new values: a copy, and valid by its rules. Only editable columns have changed.

Original TItem

The row as it was loaded, or the default for a new one.

IsNew bool

Whether it's a new row, from NewItem.

AddError<TValue>(Expression<Func<TItem, TValue>> field, string message)

Reports a problem with the save as a whole, shown at the top of the editor.

AddError(string message)

Reports a problem with the save as a whole, shown at the top of the editor.

CopyTo(TItem target)

Copies the editable columns' new values to target, such as an entity just read from the database, and leaves the rest of it alone.

DataGridSmallScreen

enum

What a DataGrid does when its columns don't fit.

DataGridSmallScreen values
ValueDescription
Scroll

It scrolls sideways. The default.

HideColumns

Columns hide, lowest Priority first, and their values show in the row's detail, opened by the button at the row's start.

DataGroupRequest

record

What a DataGrid asks its GroupsProvider for: one level of groups with their counts and aggregates, or, with no Keys, the one group of everything that matches, which is the grand total. Rows aren't part of it: an open group's rows come from the ItemsProvider, with the group's values in its filter. Answer it with ToResultAsync.

DataGroupRequest members
MemberDescription
Keys IReadOnlyList<SortField>

The fields to group by, outermost first, and the order of each; empty for the grand total.

Aggregates IReadOnlyList<DataAggregateField>

What to work out for each group, besides its count.

Filter Filter?

The filter, or null for none.

Search string?

Free text to look for, in the searchable fields; null for none.

Skip int = 0

Groups to skip.

Take int?

Groups to take; null for every group.

NeedsTotal bool = false

Whether the component needs how many groups there are in all.

CancellationToken CancellationToken = CancellationToken.None

Canceled when the component no longer needs this answer.

ToQueryString()

The request as a query string, for a GET API: group=status,-customer&aggregate=total:sum&skip=20&take=10&filter=...&search=..., with total=true when it needs the number of groups. Read it back with Parse.

ToResult(IQueryable<TItem> source)

The groups, from an in-memory list or a synchronous query, with the component's fields.

ToResult(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

The groups, through these fields only, for a request that came over the wire: a key that isn't Groupable or an aggregate that isn't Aggregatable is left out, so a request can't reach other properties.

ToResultAsync(IQueryable<TItem> source, Func<IQueryable<object?[]>, CancellationToken, Task<int>> count, Func<IQueryable<object?[]>, CancellationToken, Task<List<object?[]>>> list)

The groups through your async methods, so Core needs no EF Core: count: (q, ct) => q.CountAsync(ct), list: (q, ct) => q.ToListAsync(ct).

ToResultAsync(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields, Func<IQueryable<object?[]>, CancellationToken, Task<int>> count, Func<IQueryable<object?[]>, CancellationToken, Task<List<object?[]>>> list)

The groups through your async methods, through these fields only.

DataGroupResult

record

What a GroupsProvider returns.

DataGroupResult members
MemberDescription
Groups IReadOnlyList<DataGroup>

The groups, in order. For a grand total, one.

Total int?

How many groups there are in all, when the request's NeedsTotal asks.

DataPaging

enum

How a Table<T> or ListView with a PageSize moves through its pages.

DataPaging values
ValueDescription
Pages

Numbered pages and "1–10 of 42". Needs the total (Total). The default.

NextPrevious

First, previous and next only, by cursor (Next): for data that has no total, or that pages by a token. Each page replaces the one shown.

LoadMore

A "Load more" button after the items that adds the next page to them, by cursor: for a ListView (a Table pages by number, by cursor or on scroll). On static pages and with JavaScript off it's a link to the same list with one more page (?page=3 shows the first three pages, asked of the provider as one request from the start); with script, focus goes to the first item it added.

LoadOnScroll

The next page loads when the last item scrolls into view and is added to the items: in place on interactive pages, and on static pages by following the Load more link, which enhanced navigation patches in with the scroll kept. The button is there only for the keyboard: out of sight until it has focus, with a spinner in its place while a page loads. With JavaScript off it shows, and grows the list by a page as for DataPaging.LoadMore. Best with a MaxHeight, so content under it stays within reach.

DataRequest

record

What a data component (a Table<T>) asks its ItemsProvider for: a range of rows, sorted and filtered, or the page after a cursor. Apply it to a query with ToResultAsync or Apply; the component's columns say how each key reads an item, so a provider never maps keys to properties itself. It travels: to JSON with System.Text.Json, and to a query string with ToQueryString, for a WebAssembly app that calls an API, where Apply applies it through the fields the server declares.

DataRequest members
MemberDescription
Sort IReadOnlyList<SortField>

The sort, first key first; empty for the source's own order.

Filter Filter?

The filter, or null for none.

Search string?

Free text to look for, in the searchable fields (text, by default); null for none.

Skip int = 0

Rows to skip: any offset, such as 1,036 for a virtual-scrolling grid.

Take int?

Rows to take; null for every row.

Cursor string?

When the component pages by cursor (DataPaging), the Next or Previous of an earlier page, as it was given; null for the first page. Skip is then the page's position (rows 401–600 at 200 a page).

NeedsTotal bool = true

Whether the component needs the total count. False when it pages by cursor, where the total is optional.

CancellationToken CancellationToken = CancellationToken.None

Canceled when the component no longer needs this answer (a newer request, or it went away).

Page int = 1

The page, from 1, for a source that thinks in pages: Skip / Take + 1.

Apply(IQueryable<TItem> source)

Filters, searches, sorts and takes the range of a query, with the component's fields. EF Core translates it.

Apply(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

Filters, searches, sorts and takes the range of a query, mapping keys through these fields only: on a server, for a request that came over the wire. A filter on a key that isn't one of them (or isn't filterable) matches nothing, and a sort by one is left out, so a request can't reach other properties.

ApplyFiltering(IQueryable<TItem> source)

Keeps what the filter and search match, with the component's fields: count this for the total.

ApplyFiltering(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

Keeps what the filter and search match, through these fields only.

ApplySorting(IQueryable<TItem> source)

Sorts a query, with the component's fields.

ApplySorting(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

Sorts a query by the sortable fields named in Sort, through these fields only.

ToODataQuery()

The request as OData query options, for a provider whose API is an OData endpoint: $filter=...&$orderby=customer,total desc&$skip=20&$top=10&$count=true&$search=.... Text that ignores case compares lower-cased (contains(tolower(customer),'ada')), as OData matches case; field paths use /. A cursor isn't part of OData: pass Cursor (or its $skiptoken) yourself. Values are written as the component's fields' types, so a Guid or a date that came back from JSON as text is written as one.

ToODataQuery(IReadOnlyList<DataField<TItem>> fields)

The request as OData query options, with values written as these fields' types.

ToQueryString()

The request as a query string, for a GET API: sort=customer,-total&skip=20&take=10&filter=...&search=...&cursor=..., with total=false when it doesn't need the total. The filter is in the form Parse reads (MatchCase isn't written). Read it back with Parse.

ToResult(IQueryable<TItem> source)

The count of what the filter keeps (when NeedsTotal) and this range's items, with the component's fields, from an in-memory list or a synchronous query.

ToResult(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

The count and items, through these fields only (see Apply).

ToResultAsync(IQueryable<TItem> source, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list)

The count of what the filter keeps (only when NeedsTotal) and this range's items, with the component's fields, through your async methods, so Core needs no EF Core: count: (q, ct) => q.CountAsync(ct), list: (q, ct) => q.ToListAsync(ct). Both get the request's CancellationToken.

ToResultAsync(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list)

The count and items through your async methods, mapping keys through these fields only.

DataResult

record

What an ItemsProvider returns: the rows asked for, and the total count or the cursors of the pages around them.

DataResult members
MemberDescription
Items IReadOnlyList<TItem>

The rows.

Total int?

How many rows match in all. A Table with numbered pages (DataPaging.Pages) needs it; paging by cursor, it's optional and adds "of 1,234" to the range.

Next string?

The cursor of the page after this one, or null on the last page. Used when the component pages by cursor.

Previous string?

The cursor of the page before this one, if your data source gives one. Without it a Table goes back to cursors it has seen on interactive pages; on static pages Previous is unavailable past the second page (First still works).

DialogSize

enum

The width of a Dialog. A Drawer, or a dialog at the start or end edge, is narrower: Sm 20rem, Md 24rem, Lg 32rem, Xl 40rem.

DialogSize values
ValueDescription
Sm

24rem. Confirmations.

Md

32rem (the default).

Lg

48rem. Forms with two columns.

Xl

64rem. Tables and previews.

Full

The whole viewport.

Filter

record

A filter on data: a condition on one field (FieldFilter), conditions joined by and or or (FilterGroup), or the opposite of one (NotFilter). Fields are named by their key (a column's SortKey, or a DataField<T>'s Key). It becomes a LINQ expression on the fields' own properties, so an EF Core query filters in the database; a value never becomes code.

Filter members
MemberDescription
Parse(string text)

Reads a filter written in the subset of OData's $filter that ?filter= takes: total ge 100 and (status in ('Paid','Pending') or customer contains 'ada'). Comparisons (eq ne gt ge lt le), in, and or not, parentheses, contains, startswith and endswith (as functions or between field and value), date(field) eq 2026-01-31 for a day, and null. Text matches ignoring case, as a Table's filters do (OData's own contains matches case).

Find(string field)

The condition on field that every match must meet: this filter itself, or one inside its and groups (not inside an or group or a not). Null when there's none. For a provider that passes conditions on to an API: request.Filter?.Find("who")?.Value.

FilterCase

enum

How text compares in a filter.

FilterCase values
ValueDescription
IgnoreCase

Upper and lower case are the same: both sides are lowered, which a database index can't serve. The default.

MatchCase

Upper and lower case differ, as far as the data's own comparison goes: text is compared as it is. In memory, that's exact. A database still has its say: SQLite's LIKE, which EF Core uses for a starts-with or ends-with, ignores case in ASCII.

Database

Text is compared as it is, and the database's collation decides, so an index can serve it. On a list in memory, that's the same as FilterCase.MatchCase.

FormLayout

enum

How a Form lays out labels and fields.

FormLayout values
ValueDescription
Vertical

Labels above fields (the default).

Horizontal

Labels in a column to the left of fields, from 640px up.

Length

struct

A width, height or flex basis: a size token, a keyword, or a CSS length built with a factory such as Rem.

Length members
MemberDescription
Sm

640px (matches the sm breakpoint).

Md

768px (matches the md breakpoint).

Lg

1024px (matches the lg breakpoint).

Xl

1280px (matches the xl breakpoint).

Prose

A comfortable reading width, 68 characters.

Full

100% of the containing block.

Auto

auto.

FitContent

fit-content: as wide as the content, up to the available space.

MinContent

min-content.

MaxContent

max-content.

Px(double value)

Pixels.

Rem(double value)

Root ems (16px each by default).

Percent(double value)

Percent of the containing block.

Ch(double value)

Character widths, for text measures.

Vw(double value)

Percent of the viewport width.

Dvh(double value)

Percent of the dynamic viewport height (accounts for mobile browser bars).

Of(string css)

Any CSS length, such as calc(100% - 2rem). Checked for unsafe characters.

Css string

The CSS value this length renders as.

RowActionOverflow

enum

Where a row's action shows in a DataGrid's ActionColumn<T>.

RowActionOverflow values
ValueDescription
Auto

A button in the row, until the grid hides columns to fit (DataGridSmallScreen.HideColumns); then in the row's ⋮ menu. The default.

Never

A button in the row, always.

Always

In the row's ⋮ menu.

SelectAllMode

enum

What a select-all checkbox selects.

SelectAllMode values
ValueDescription
Page

The items on this page.

All

Every item the filters match, on any page, as a Selection that says so rather than listing them.

Selection

class

The items selected in a Table or ListView: some keys, or every item matching a filter and search except some keys (SelectAllMode.All). Bind it with @bind-Selection, or on a static page with [SupplyParameterFromForm(FormName = "...", Name = "...")] under the view's SelectionName. For a bulk action, Apply gives the selected items from a query.

Selection members
MemberDescription
None

Nothing selected.

Of(IEnumerable<string> keys)

These keys selected.

AllOf<TItem>(DataRequest<TItem> request)
Keys string[]?

The selected keys; with All, the keys left out.

All bool = false

Every item matching Filter and Search is selected, except Keys.

Filter string?

With All, the filter it was made under, in the ?filter= form; null for none.

Search string?

With All, the search it was made under; null for none.

KeyList string?

The keys as one JSON list, as the script posts a selection kept across pages: one field rather than one per key, which stays under the server's limit of 1,024 form values. Added to Keys. For the form post, not for code.

IsEmpty bool = true

Nothing is selected.

Apply<TItem>(IQueryable<TItem> source, Expression<Func<TItem, string>> key)
Apply<TItem>(IQueryable<TItem> source, Expression<Func<TItem, string>> key, IReadOnlyList<DataField<TItem>> fields)
Contains(string key)

Whether the item with this key is selected (for All, among the matching items).

Count(int? total)

How many are selected, given how many match; null when All and the total isn't known.

MatchesScope(Filter? filter, string? search)

Whether All was made under this filter and search; when not, the selection no longer means the same items.

With(string key, bool selected)

A copy with this key selected or cleared.

SelectionMode

enum

How many items can be selected.

SelectionMode values
ValueDescription
None

No selection. The default.

Single

One item, with a radio button on each.

Multiple

Any number, with a checkbox on each; with script, a box to select them all (see SelectAllMode).

ToolbarOverflow

enum

When an item of a Toolbar moves into its "…" menu.

ToolbarOverflow values
ValueDescription
Auto

When there's no room for it, in order of Priority (the default).

Never

Never: it stays in the bar, such as the main action.

Always

Always: it's only in the menu, such as Print or Version history.

ToolbarPosition

enum

Where an item of a Toolbar sits.

ToolbarPosition values
ValueDescription
Start

At the start (the left in left-to-right text), the default.

Center

In the middle, kept centered between the start and the end.

End

At the end, before the "…" menu.

Connection lost

Rejoining the server…