DataGrid
Since 0.1.0-alpha.20IzzyBlazor.DataGrid<TItem> in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.20 assembly
and its doc comments.
Properties (82)
DetailTemplateRenderFragment<TItem>?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>?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>?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 = falseWhether every row's detail starts open.
SingleDetailbool = falseOpening a row's detail closes the one that was open. There's no button to open them all.
Groupablebool = falseLets 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?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?The grouping when the URL has none, such as "status".
GroupsOpenbool = falseWhether groups start open. They start closed by default, which is what a page of groups is for.
@bind-OpenGroupsIReadOnlyList<string>?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 = 100The 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 = falseKeeps 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 = falseKeeps a grouped column in the table. By default it leaves, as each group's row says its value.
SmallScreenDataGridSmallScreen = DataGridSmallScreen.ScrollWhat 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)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.
FindItemFunc<string, Task<TItem>>?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>?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>?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>?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?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>?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?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?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?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 = falseLets 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 = falseLets 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 = falseA 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 = falseDraws 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 = 48The 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 = falseText 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?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?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?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 = falseA 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.
@bind-Searchstring?The words searched for. Binding it (@bind-Search) on an interactive page keeps them, with sort and page, in the component.
SearchLabelstring? = "Search"The search box's name and placeholder. Defaults to "Search".
FilterRowbool = falseAdds 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 = falseAdds 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>>?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?The columns: PropertyColumn<T1, T2> and TemplateColumn<T>.
InitialSortstring?The sort when the URL has none, such as "name" or "-date" (descending). A DataGrid takes several: "status,-date".
@bind-Sortstring?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?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.IgnoreCaseHow 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 = falseA 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?The table's name for screen readers (a visually hidden caption).
RowClassFunc<TItem, string?>?A class for each row, such as one that highlights overdue orders.
RowHoverbool = falseHighlights 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 = falseAlternating row backgrounds.
RowLinesbool = trueA line between rows. Defaults to true; the line under the header always shows.
ColumnLinesbool = falseA line between columns. Defaults to false.
ShadedHeaderbool = falseShades 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 = trueA rounded border around the table. Defaults to true; false for a table that sits inside a card or panel.
SizeControlSize = ControlSize.MdRow height and text size. ControlSize.Sm for dense data. Defaults to ControlSize.Md.
MaxHeightLength?A height limit: the rows scroll and the header stays in view.
RowHrefFunc<TItem, string?>?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>?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)Names a row for screen readers, in its link and its checkbox. Defaults to ItemKey.
FilterFromAddressbool = falseApplies 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>?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>>>?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?Items per page. Leave it out to show every item.
PageSizeOptionsIReadOnlyList<int>?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?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.PagesHow 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"The "Load more" button's text, such as "Load earlier". Defaults to "Load more".
@bind-Cursorstring?QueryPrefixstring = ""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)Shown when there are no items. Defaults to EmptyText.
EmptyTextstring? = "No items"The text when there are no items. Defaults to "No items".
ErrorContentRenderFragment?Shown in place of "Couldn't load the rows." when loading fails, before the Retry button.
ItemKeyFunc<TItem, string>? (computed)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 = falseShows it as loading: items dim, or placeholders show while there are none. Set automatically while an ItemsProvider loads on interactive pages.
SelectionModeSelectionMode = SelectionMode.NoneWhether 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)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?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>?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.PageWhat 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>?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"The select-all checkbox's name for screen readers. Defaults to "Select all rows".
SelectRowLabelstring? = "Select"The start of each item checkbox's name for screen readers, before the item's label. Defaults to "Select".
Plus 16 item props and 4 common props.
Show them hereEvents (2)
OnSaveEventCallback<DataGridSave<TItem>>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>>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)
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>?The row's actions: EditAction, DeleteAction and RowAction. context is the row.
OverflowRowActionOverflow = RowActionOverflow.AutoWhere 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?Its icon.
Labelstring requiredWhat 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?Makes it a link.
Namestring?Valuestring?The value the button posts.
Formstring?The id of the form it submits. Setting it makes it a submit button.
Disabledbool = falseWhether it can't be used.
Visiblebool = trueWhether this row has it.
OverflowRowActionOverflow? (computed)Where it shows. Defaults to the column's Overflow.
OnClickEventCallbackRuns 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?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 = trueWhether this row has it.
OverflowRowActionOverflow? (computed)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?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 = trueWhether this row has it.
OverflowRowActionOverflow? (computed)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?The fields, and whatever goes around them.
Columnsint = 1The columns the fields are laid out in, as Form's Columns. Defaults to 1.
LayoutFormLayout = FormLayout.VerticalHow labels sit next to fields, as Form's Layout.
SizeDialogSize = DialogSize.MdThe dialog's size.
TitleFunc<TItem, string>? (computed)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>.
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>>?The form. Call context.CloseAsync() when it has saved.
SizeDialogSize = DialogSize.MdThe dialog's size.
TitleFunc<TItem, string>? (computed)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.
DataGridSearch
Puts a DataGrid's search box, from Searchable, among your toolbar items. It stays in the bar, as a box.
PositionToolbarPosition = ToolbarPosition.StartWhere 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 = 0Which items stay longest when there's no room: higher stays longer. Defaults to 0.
OverflowToolbarOverflow = ToolbarOverflow.AutoWhen it moves into the "…" menu. Defaults to ToolbarOverflow.Auto.
ShowTextbool? (computed)Its text beside its icon, or only its icon. Defaults to the grid's ToolbarLabels.
PositionToolbarPosition = ToolbarPosition.EndWhere 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.
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.
Types (23)
ControlSize
enumThe 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.
| Value | Description |
|---|---|
Sm | 32px tall, small text. |
Md | 36px tall (the default). |
Lg | 44px tall, large text. For touch-first and marketing pages. |
DataGridDelete
classA delete from a DataGrid, for its OnDelete. With no error added, the dialog closes and the rows load again.
| Member | Description |
|---|---|
Item TItem | The row to delete. |
AddError(string message) | Reports why it can't be deleted, shown in the dialog, which stays open. |
DataGridEditFormContext
classWhat a EditFormTemplate<T> gets.
| Member | Description |
|---|---|
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 |
CloseAsync() | Closes the dialog and loads the rows again, once your form has saved. |
DataGridEditMode
enumHow a DataGrid edits a row.
| Value | Description |
|---|---|
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. |
DataGridLayout
recordHow 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.
| Member | Description |
|---|---|
Parse(string? json) | A layout from |
Columns IReadOnlyList<DataGridColumnLayout> | The columns that differ from their declaration. |
Column(string key) | A column's entry, by its key (its |
ToJson() | The layout as JSON, as a cookie holds it. |
DataGridSave
classA 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.
| Member | Description |
|---|---|
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 |
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 |
DataGridSmallScreen
enumWhat a DataGrid does when its columns don't fit.
| Value | Description |
|---|---|
Scroll | It scrolls sideways. The default. |
HideColumns | Columns hide, lowest |
DataGroupRequest
recordWhat 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.
| Member | Description |
|---|---|
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: |
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 |
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: |
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
recordWhat a GroupsProvider returns.
| Member | Description |
|---|---|
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 |
DataPaging
enumHow a Table<T> or ListView with a PageSize moves through its pages.
| Value | Description |
|---|---|
Pages | Numbered pages and "1–10 of 42". Needs the total ( |
NextPrevious | First, previous and next only, by cursor ( |
LoadMore | A "Load more" button after the items that adds the next page to them, by cursor: for a |
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 |
DataRequest
recordWhat 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.
| Member | Description |
|---|---|
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 ( |
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 | |
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 |
ToODataQuery() | The request as OData query options, for a provider whose API is an OData endpoint: |
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: |
ToResult(IQueryable<TItem> source) | The count of what the filter keeps (when |
ToResult(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields) | The count and items, through these fields only (see |
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 |
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
recordWhat an ItemsProvider returns: the rows asked for, and the total count or the cursors of the pages around them.
| Member | Description |
|---|---|
Items IReadOnlyList<TItem> | The rows. |
Total int? | How many rows match in all. A Table with numbered pages ( |
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
enumThe 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.
| Value | Description |
|---|---|
Sm | 24rem. Confirmations. |
Md | 32rem (the default). |
Lg | 48rem. Forms with two columns. |
Xl | 64rem. Tables and previews. |
Full | The whole viewport. |
Filter
recordA 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.
| Member | Description |
|---|---|
Parse(string text) | Reads a filter written in the subset of OData's |
Find(string field) | The condition on |
FilterCase
enumHow text compares in a filter.
| Value | Description |
|---|---|
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 |
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 |
FormLayout
enumHow a Form lays out labels and fields.
| Value | Description |
|---|---|
Vertical | Labels above fields (the default). |
Horizontal | Labels in a column to the left of fields, from 640px up. |
Length
structA width, height or flex basis: a size token, a keyword, or a CSS length built with a factory such as Rem.
| Member | Description |
|---|---|
Sm | 640px (matches the |
Md | 768px (matches the |
Lg | 1024px (matches the |
Xl | 1280px (matches the |
Prose | A comfortable reading width, 68 characters. |
Full | 100% of the containing block. |
Auto |
|
FitContent |
|
MinContent |
|
MaxContent |
|
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 |
Css string | The CSS value this length renders as. |
RowActionOverflow
enumWhere a row's action shows in a DataGrid's ActionColumn<T>.
| Value | Description |
|---|---|
Auto | A button in the row, until the grid hides columns to fit ( |
Never | A button in the row, always. |
Always | In the row's ⋮ menu. |
SelectAllMode
enumWhat a select-all checkbox selects.
| Value | Description |
|---|---|
Page | The items on this page. |
All | Every item the filters match, on any page, as a |
Selection
classThe 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.
| Member | Description |
|---|---|
None | Nothing selected. |
Of(IEnumerable<string> keys) | These keys selected. |
AllOf<TItem>(DataRequest<TItem> request) | |
Keys string[]? | The selected keys; with |
All bool = false | |
Filter string? | With |
Search string? | With |
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 |
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 |
Count(int? total) | How many are selected, given how many match; null when |
MatchesScope(Filter? filter, string? search) | Whether |
With(string key, bool selected) | A copy with this key selected or cleared. |
SelectionMode
enumHow many items can be selected.
| Value | Description |
|---|---|
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 |
ToolbarOverflow
enumWhen an item of a Toolbar moves into its "…" menu.
| Value | Description |
|---|---|
Auto | When there's no room for it, in order of |
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
enumWhere an item of a Toolbar sits.
| Value | Description |
|---|---|
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. |