Extras
DataGrid
BitDataGrid displays an information-rich data table and gives people the tools to work through it: sorting, quick search and per-column filters, paging, grouping with aggregates, selection, inline editing, resizable/reorderable/frozen columns, master-detail and tree rows, keyboard cell navigation, row and column virtualization, and CSV/Excel export. Bind a list, an IQueryable executed at the source, or a callback for server-side paging or infinite scrolling. Use a data grid when information density is critical.
Editing, grouping & templates
Inline row and cell editing with validation, grouping with group and footer aggregates, cell, header and footer templates with custom sort keys, and master-detail rows.
Inline editing
The grid edits the row object but never your list: the built-in editors write into a buffer, and only Save writes it to the row and raises OnRowSave - persist the change there. Cancel (or Esc) drops the buffer and raises OnRowCancel. OnRowCreate hands over the row NewItemFactory built as it opens for editing, and OnRowDelete the row to delete: the grid only deselects it, so remove it from Items yourself. One row is edited at a time, and while it is open, row clicks neither select nor expand anything.
A column is editable when the grid (or its own Editable) says so and it is bound to a property with a setter;
Editable="false" keeps ID read-only here, and template-only columns are never edited. The editor follows
DataType: a text box, a number box, a date picker, or a dropdown for booleans and enums. A value that cannot be
converted shows Strings.InvalidValueError. Validate receives the row and the converted value and returns an
error message, or null to accept it; while any column has an error, saving is refused and the message
shows under its editor. A column's EditTemplate replaces the built-in editor with your own markup; it binds
straight to the row rather than to the buffer, and Cancel restores the values the row had when the edit began.
Cell mode turns cell navigation on, and Tab saves and moves to the next editable cell. From code: BeginEdit / BeginEditAsync (a row, or a cell by column id), CommitEditAsync, CancelEditAsync, AddNewRowAsync and DeleteRowAsync; EditingItem and EditingColumnId tell what is open. A row type that is a struct cannot be edited, since the grid would only change a copy.
Grouping & aggregates
Grouping works on in-memory lists only: it is not offered with OnRead, OnLoadMore, an IQueryable or a tree, and a column needs a bound property to be grouped by. A grouped grid shows every row, so the pager is set aside while it is grouped. Groupable on a column overrides the grid's. From code, GroupByAsync adds a level, UngroupAsync removes one and ClearGroupsAsync all of them; OnGroupChange reports the new grouping. Expand-all and collapse-all also hold for groups built later, after a regrouping or new data.
Aggregate picks a built-in function - Sum, Average (of the numeric values), Count (of the rows), Min or Max (of the non-null values) - and AggregateBy takes the group's (or the whole view's) rows and returns any value, winning over Aggregate. The result is formatted with AggregateFormat, or else the column's Format. The group header shows the aggregates beside its title and count; ShowFooter adds a footer row with the same aggregates over every row of the view, whatever the page.
Templates
A Template only changes how a cell looks: a bound column still sorts, filters, searches, groups and exports by its value, so Rating and Stock above keep all of that. FooterTemplate receives the column's BitDataGridAggregateResult (Value, FormattedValue, Type), so it renders only where the column has an Aggregate or AggregateBy and the footer is on. A template owns its markup, so the cell tooltips of ShowCellTooltips are not added to it.
A template-only column (no Property or Field, like Value) has no value of its own: give it a ColumnId, since its id is otherwise generated, and know that it is not filtered, grouped, searched or exported unless you give it an ExportValue (see Export). SortBy and Comparer run in memory only: an IQueryable sorts a bound column by its property and cannot sort a template-only one, and OnRead / OnLoadMore receive the column id to sort by - a template-only column takes part there with ServerSortable and a ColumnId. SortBy on a bound column replaces its value as the sort key.
Detail rows
With ExpandDetailOnRowClick a click also selects the row in Single SelectionMode; clicks on the toggle, checkbox, reorder and command cells, and on a control inside a cell, open nothing. Several rows can be open at once. Binding ExpandedDetailItems puts the open rows in your hands - the grid then only reports changes through ExpandedDetailItemsChanged; leave it unset and drive the rows with ExpandDetailAsync, CollapseDetailAsync, ToggleDetailAsync, SetDetailExpandedAsync, ExpandAllDetailsAsync (the rows of the view - only the loaded ones with OnRead, an IQueryable or OnLoadMore) and CollapseAllDetailsAsync, and read them with IsDetailExpanded. OnDetailToggle reports a single row's toggle, with the row and whether it opened.
A detail row is as tall as its content, which Virtualize cannot measure: pair detail rows with paging rather than virtualization. A grid nested in a detail row is a grid of its own; give it an AriaLabel that says whose rows it shows.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.