Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

TreeList

Since 0.1.0-alpha.24
Shows rows nested in rows, such as an org chart or a folder tree, in a grid's columns.

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

Properties (95)

ItemChildrenFunc<TItem, IEnumerable<TItem>?>?Added in 0.1.0-alpha.24

A row's children, for nested data: Items are then the top rows. Set this or ItemParentKey.

ItemParentKeyFunc<TItem, string?>?Added in 0.1.0-alpha.24

A row's parent's key, for a flat list such as a table with a ParentId: Items are then every row, and a row whose parent key is null, or isn't another row's key, is a top row. Set this or ItemChildren.

@bind-ExpandedItemsIReadOnlyList<string>?Added in 0.1.0-alpha.24 @bind: Interactive only

Which rows are open, by key; "*" opens every row, "!*" closes every row, and "!key" closes one. Binding it (@bind-ExpandedItems) on an interactive page keeps it in the component; otherwise it's in the address, as ?open=.

ExpandAllbool = falseAdded in 0.1.0-alpha.24

Whether every row starts open. They start closed by default, showing the top rows.

ItemExpandedFunc<TItem, bool>?Added in 0.1.0-alpha.24

Starts chosen rows open, such as the top level of an org chart.

ItemIconFunc<TItem, bool, IconData?>?Added in 0.1.0-alpha.24

An icon before a row's value in the first column; the flag says whether the row is open, for an open or a closed folder.

FilterBranchbool = falseAdded in 0.1.0-alpha.24

While filtering or searching, keeps the rows under a match too, not only the match and the rows above it: a search for a department shows its people.

ItemHasChildrenFunc<TItem, bool>?Added in 0.1.0-alpha.24

Whether a row has rows under it, so it gets a chevron before they load, with an ItemsProvider. Without it every row gets one, and a row that opens to none loses it.

ChildRowLimitint = 200Added in 0.1.0-alpha.24

The most rows shown under one row; a Show more row after them shows as many again. 200 by default.

Cascadebool = trueAdded in 0.1.0-alpha.24

With SelectionMode.Multiple, checking a row checks the rows under it, and a row with some of them checked shows a mixed box. A checked row stands for its whole branch: rows under it come in checked as they're drawn, and ApplyTree finds them all. On by default; false makes each box its own.

NewChildFunc<TItem, TItem>?Added in 0.1.0-alpha.24

A new row's starting values under the row given, such as its parent's id set. Setting it lets an AddChildAction add rows under others; OnSave gets the row with IsNew set. NewItem still adds top rows, from the toolbar.

ItemMovableFunc<TItem, bool>?Added in 0.1.0-alpha.24

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

MoveByDragbool = falseAdded in 0.1.0-alpha.24

Gives each row a handle to drag it before, after or into another row, never into its own branch. Needs OnReparent, which gets the row's new parent and place. A drop moves the row at once, on a static page by a form post. Pressed, or from the keyboard, the handle opens the Move dialog, as a MoveAction does, and so does a drop OnReparent turns down, with its reason.

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

With an ItemsProvider, works out the footer's aggregates (a column's Aggregate) over every row the filters match, as the rows it holds are only a page's: answer it with request.ToResultAsync over the same query.

Virtualizebool = falseAdded in 0.1.0-alpha.24

Draws only the rows in view, as they scroll, for a tree with many rows open: every visible row is worked out from Items, and opening a row keeps the place. Interactive pages only (a static one pages by top rows); needs a MaxHeight, and each row one line of RowHeight. There's no Show more: every row under an open one is in the list.

RowHeightdouble = 48Added in 0.1.0-alpha.24

The height of every row, in pixels, with Virtualize. Text past it is cut short.

SmallScreenDataGridSmallScreen = DataGridSmallScreen.ScrollAdded in 0.1.0-alpha.24

What it does when its columns don't fit its width. DataGridSmallScreen.Scroll (the default) scrolls sideways; DataGridSmallScreen.HideColumns scrolls until the grid is narrower than a phone's screen (40rem), then 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.24

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.24

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

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

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.24

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

AddTextstring? (computed)Added in 0.1.0-alpha.24

The Add button's text, such as "Add customer". Defaults to "Add" (IzzyText). With ToolbarLabels or a DataGridAdd showing its label, the button is the toolbar's primary one: solid, in the primary accent.

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

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.24

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.

RowActionsbool = trueAdded in 0.1.0-alpha.24

Whether rows have their actions: Edit, Delete and an ActionColumn's. Defaults to true. False for a grid whose rows link to a page that has them: the dialogs still open from their addresses (/contacts?edit=42), and the grid has no actions column.

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

A link from another page can open the dialog and come back: /contacts?edit=42&return=/contacts/42 goes to return, a path on this site, when the dialog saves or closes, in place of the grid's page. 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.24

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.

EditDialogRenderFragment?Added in 0.1.0-alpha.24

Arranges the generated edit dialog's fields: 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.

EditDialogFormRenderFragment<DataGridEditFormContext<TItem>>?Added in 0.1.0-alpha.24

Your own form in the 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. Call context.CloseAsync() when it has saved. Needs EditMode="DataGridEditMode.Dialog".

EditColumnsint = 1Added in 0.1.0-alpha.24

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

EditLayoutFormLayout = FormLayout.VerticalAdded in 0.1.0-alpha.24

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

EditDialogSizeDialogSize? (computed)Added in 0.1.0-alpha.24

The edit dialog's size. Defaults to one wide enough for EditColumns: DialogSize.Md for one column, DialogSize.Lg for two, DialogSize.Xl for more (a form shows columns only when it has the width for them).

EditDialogTitleFunc<TItem, string>? (computed)Added in 0.1.0-alpha.24

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

EditSaveTextFunc<TItem, string>? (computed)Added in 0.1.0-alpha.24

The edit dialog's submit button, from the row (none for a new one), so it says what happens: u => u is null ? "Send invite" : "Save". Defaults to AddText ("Add") for a new row, which the button adds, and "Save" for one being edited.

LayoutKeystring?Added in 0.1.0-alpha.24

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.24 @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.24

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.24

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.24

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.24

A button above the grid that opens a list of the columns, in the grid's order, each band's under it: tick to show or hide, search by title, drag a handle (or open its menu, or Alt+Up and Down) to move, and reset to the columns as declared. Each header's menu opens it too. Needs script, and on a static page a LayoutKey or LayoutSaveUrl.

ToolbarLabelsbool = falseAdded in 0.1.0-alpha.24

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.24

A link in the toolbar, in a menu with ExportExcelHref and any DataGridExportFormat, 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.24

A link in the toolbar, in a menu with ExportCsvHref and any DataGridExportFormat, 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.24

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.24

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.

SelectOnClickbool = falseAdded in 0.1.0-alpha.24

A click on a row selects it, with IzzyBlazor's script; clicks on its links, buttons and fields stay theirs. With one row (SelectionMode.Single) the radio buttons are hidden, and Space on the selected row clears it. With several, a click selects only that row, Ctrl+click adds or removes one and Shift+click a range, and the checkboxes stay.

WrapCellsbool = trueAdded in 0.1.0-alpha.24

Whether text too long for its column wraps onto more lines, making the row taller (true, the default), or stays on one line, ending in an ellipsis, with the whole text in a tooltip when a cell is hovered or focused. A column's Wrap overrides it. With Virtualize, cells stay on one line.

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

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

FilterRowbool = falseAdded in 0.1.0-alpha.24

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.24

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.

ColumnsRenderFragment?Added in 0.1.0-alpha.24
InitialSortstring?Added in 0.1.0-alpha.24

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.24 @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.24 @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.24

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.24

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.24

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

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

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

RowHoverbool = falseAdded in 0.1.0-alpha.24

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.24

Alternating row backgrounds.

RowLinesbool = trueAdded in 0.1.0-alpha.24

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

ColumnLinesbool = falseAdded in 0.1.0-alpha.24

A line between columns. Defaults to false.

ShadedHeaderbool = falseAdded in 0.1.0-alpha.24

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.24

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.24

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

MaxHeightLength?Added in 0.1.0-alpha.24

A height limit: the rows scroll and the header stays in view. Without one, a table with Grow on a page that fills a ShellScroll.Main shell's main area takes the height left instead.

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

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.24

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.24

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

FilterFromQuerybool = falseAdded in 0.1.0-alpha.24

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.24

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.24

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.24 @bind: Interactive only

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

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

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.24 @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.24

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.24

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

@bind-Cursorstring?Added in 0.1.0-alpha.24 @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.24

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.24

Shown when there are no items. Defaults to EmptyText.

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

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

NoMatchesTextstring? = "No matches for “{0}”"Added in 0.1.0-alpha.24

A grid's text when its search matches no rows, with {0} for the words: "No customers match “{0}”". Defaults to "No matches for “{0}”". EmptyContent is for when there are no rows at all.

NoMatchesContentRenderFragment<string>?Added in 0.1.0-alpha.24

Shown in place of NoMatchesText when a grid's search matches no rows, with the words searched for as its context: an EmptyState with an icon and a line on what to try. The grid's own "Clear search" stays under it, so it needs no action of its own.

ErrorContentRenderFragment?Added in 0.1.0-alpha.24

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.24

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.24

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.24

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.24

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.24 @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.24

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.24

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.24

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.24

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

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

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

Events (3)

OnReparentEventCallback<TreeListMove<TItem>>Added in 0.1.0-alpha.24

Saves a row moved under another, or to the top level, from a MoveAction's dialog. With no error added, the dialog closes and the rows load again. Needs Items.

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

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.24

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 (2)

ExportHrefAdded in 0.1.0-alpha.24
string ExportHref(string href)

href with what the grid's export links add: the current filter, sort (after its groups') and search, and the shown, exportable columns, for every row that matches, not one page. For a button of your own on an interactive page: call it when the button is clicked, such as Nav.NavigateTo(grid.ExportHref("/orders.json"), forceLoad: true), as the grid's filter and sort change without the page rendering again. On a static page, a DataGridExportFormat puts the link in the grid's export.

ReloadAsyncAdded in 0.1.0-alpha.24
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 (2)

Components written inside TreeList, documented here with it.

AddChildAction

A TreeList row's Add child action: adds a row under it, from the tree list's NewChild, in the edit dialog or in place under it, and opens it so the new row shows.

Visiblebool = trueAdded in 0.1.0-alpha.24

Whether this row has it.

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

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

MoveAction

A TreeList row's Move action: a dialog to choose the row it goes under, or the top level, for the tree list's OnReparent to save. Its own branch can't be chosen. Works on static pages and with the keyboard alone.

Visiblebool = trueAdded in 0.1.0-alpha.24

Whether this row has it.

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

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

Types (22)

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 DataGrid's EditDialogForm 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, at any width. The default.

HideColumns

It scrolls sideways until it's narrower than a phone's screen (40rem, 640px); then columns hide, lowest Priority first, and their values show in the row's detail, opened by the button at the row's start. Wider, every column and the row's actions keep their place.

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).

Parent string?

For a TreeList<T>: the key of the row whose children to load, or null for the top rows. ToTreeResult answers it.

FilterBranch bool = false

For a TreeList<T> set to FilterBranch: while filtering, keep the rows under a match too, not only the match and the rows above it.

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=... (and a tree's parent= and branch=true), 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.

ToTreeResult<TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent)
ToTreeResultAsync<TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list)

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)
ApplyTree<TItem, TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent)
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).

TreeListMove

class

A row of a TreeList<T> moved under another, or to the top level, for its OnReparent to save: set the row's parent and its place among its new siblings. With an error added, the move doesn't happen and the dialog stays open with the message.

TreeListMove members
MemberDescription
Item TItem

The row moved.

Parent TItem

The row it goes under, or default for the top level.

Index int

Where it goes among its new siblings, from 0: after them all, from the Move dialog.

HasErrors bool

Whether an error was added, which stops the move.

AddError(string message)

Stops the move and says why, in the dialog.

Connection lost

Rejoining the server…