Aggregates
Since 0.1.0-alpha.20
The members for aggregates, and the types they use. Every member of
IzzyBlazor.DataGrid<TItem> is on the DataGrid API.
Parts (1)
Components written inside DataGrid, and the columns' members, which PropertyColumn and TemplateColumn share.
PropertyColumn<TItem, TValue>
A column that shows one property of each item, formatted, and can sort by it. The title and sort key come from the property ([Display(Name)] is used when present).
AggregateDataAggregate?What this column shows in the grid's footer, worked out over every row the filters match, not just the page. Grouping isn't needed. Not for a Table.
GroupAggregateDataAggregate?What this column shows on each group's row, over the whole group, open or not.
AggregateByExpression<Func<IEnumerable<TItem>, object?>>?Your own aggregate, as an expression over the rows, so it runs in the database: g => g.Sum(o => o.Profit) / g.Sum(o => o.Total). Wherever the column's aggregate is DataAggregate.Custom; set alone, it's the footer's. Not for a Table.
AggregateFormatstring? (computed)A .NET format string for the aggregate, where every place shows the same one. Defaults to the column's own, except for a count or your own aggregate.
AggregateLabelstring? (computed)The word before the aggregate, such as "Total", where every place shows the same one; empty for none. Defaults to the aggregate's name, and to none for your own.
AggregateTemplateRenderFragment<DataGridAggregate>?An aggregate's cell, in place of its word and value, wherever it shows. In the footer, the group is all the rows.
Types (2)
DataAggregate
enumWhat a DataGrid column works out over a group of rows, or over all of them.
| Value | Description |
|---|---|
Sum | The values added up. For numbers. |
Avg | The mean of the values. For numbers. |
Min | The lowest value. For numbers, dates, times and text. |
Max | The highest value. For numbers, dates, times and text. |
Count | How many rows. |
Custom | The field's own |
DataGridAggregate
recordAn aggregate, for a column's AggregateTemplate.
| Member | Description |
|---|---|
Type DataAggregate | What it is. |
Value object? | Its value, as the column's type for a Min or Max. |
Text string? | Its value in the column's format. |
Group DataGroup | The group it's of: in the footer, all the rows. |