PivotTable Blazor API

PivotTable Properties

NameTypeDefaultDescription
ColumnReorderboolfalseSets or gets whether the reordering of columns is enabled.
ColumnsIEnumerable<IPivotTableColumn>N/ADescribes the columns of the PivotTable's original tabular data. Based on these settings and the data source, the actual columns of the PivotTable are dynamically generated.
ColumnTotalsboolfalseSets or gets whether to show total columns for each pivot data point. When enabled, all summary columns must have the same summary function set by which total columns are calculated.
ColumnTotalsPositionPivotTableColumnTotalsPositionPivotTableColumnTotalsPosition.NearSets or gets the position of total columns (shown when columnTotals is enabled).
ConditionalFormattingIEnumerable<IPivotTableConditionalFormatting>N/ASets or gets details about conditional formatting to be applied to the PivotTable's cells.
DataSourceobjectDetermines the original tabular data source of the PivotTable.
DefaultSortByRowGroupsboolfalseSets or gets whether the original tabular data sourse of the PivotTable will be pre-sorted based on columns with the rowGroup property (and their order).
DesignerboolfalseSets or gets whether to display the PivotTable's designer alongside the table itself. The designer allows for configuring column settings and applying filtering.
DesignerPositionPivotTableDesignerPositionPivotTableDesignerPosition.FarSets or gets the position of the PivotTable's designer (shown when designer is enabled).
DisabledboolfalseDisables the interaction with the element.
DrillDownboolfalseIf enabled, shows the original tabular data that has been aggregated in a PivotTable summary cell when the cell is double-clicked or F2 is pressed.
DrillDownDataExportPivotTableDrillDownDataExportPivotTableDrillDownDataExport.If set, shows an export button in the drill down dialog.
DrillDownDataExportNamestring""Sets or gets the drill down table export file name.
DrillDownTableInitAction<object>N/ASets or gets the drill down dialog callback function. The argument of the callback passed by the PivotTable is the drill-down Table component. You can use it to customize the table.
DrillDownCustomActionAction<object>N/ASets or gets the drill down custom action callback function. The argument of the callback passed by the PivotTable is the drill-down data source. You can use it to override the default drill-down UI i.e to replace our Dialog with Table.
EnableSortByRowGroupsboolfalseSets or gets whether sorting based on columns in classic row groups layout mode is enabled.
FreezeHeaderboolfalseSets or gets whether the PivotTable's column header is sticky/frozen.
GetDefaultSummaryFunctionAction<object>N/AA callback function that returns the default summary function of a summary column when it is dynamically assigned as such (e.g. by drag-drop in the designer).
GrandTotalboolfalseSets or gets whether to show a Grand total row aggregating the data of all rows.
GroupLayoutPivotTableGroupLayoutPivotTableGroupLayout.DefaultSets or gets the way row nesting (based on rowGroup columns) is displayed.
HideCellSelectionTooltipboolfalseSets or gets whether to hide the tooltip that displays details when multiple summary cells with non-null values are selected.
HideEmptyRowsboolfalseSets or gets whether to hide rows that contain only 0 or null values. Applicable only when there are rowGroup columns.
KeyboardNavigationboolfalseSets or gets whether navigation with the keyboard is enabled in the PivotTable.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the element that can be localized. Used in conjunction with the property locale.
NullDefaultValueintN/ASets or gets what value is shown in cells that do not have aggregated data to display. By default (null), such cells are empty.
OnCellRenderAction<object>N/AA callback function executed each time a PivotTable cell is rendered.
OnColumnRenderAction<object>N/AA callback function executed each time a PivotTable column header cell is rendered.
OnInitAction<object>N/AA callback function executed when the PivotTable is being initialized.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
RowSortboolfalseSets or gets whether sorting by row (when a row group cell is clicked) is enabled. When columnTotals is also enabled, sorting is applied per "column group"; otherwise - for all columns.
RowSummarybooltrueSets or gets whether row summaries are displayed in the row headers. Example: Peterson(40) vs Peterson, when rowSummary is set to false.
RowTotalsboolfalseSets or gets whether to show row total columns for each summary column.
RowTotalsPositionPivotTableRowTotalsPositionPivotTableRowTotalsPosition.NearSets or gets the position of row total columns (shown when rowTotals is enabled).
SelectionboolfalseSets or gets whether row selection (via checkboxes) is enabled.
SelectionModePivotTableSelectionModePivotTableSelectionMode.ManySets or gets the selection mode. Only applicable when selection is enabled.
SortModePivotTableSortModePivotTableSortMode.NoneDetermines the sorting mode of the PivotTable.
Themestring""Determines the theme. Theme defines the look of the element
ToolbarboolfalseSets or gets whether the PivotTable's toolbar is shown. It contains two breadcrumb components that allow the modification of the row group and pivot columns, as well as the "Conditional Formatting" and "Fields" buttons that open a dialog with additional settings.
TooltipboolfalseSets or gets whether when hovering a cell with truncated content, a tooltip with the full content will be shown.

PivotTable Methods

NameTypeArgumentsDescription
AddFiltervoidstring dataField, object filterAdds a filter to a specific column.Args: string dataField - The column's data field.,object filter - FilterGroup object.
ClearFiltersvoidN/AClears applied filters.
ClearSelectionvoidN/AClears selection.
ClearSortvoidN/AClears the PivotTable sorting.
CollapseAllRowsvoidN/ACollapses all rows (when multiple row groups are applied).
CollapseRowvoidobject rowIdCollapses a row (when multiple row groups are applied).Args: string rowId - The id of the row to collapse. Can be retrieved from the "rows" collection.
CollapseRowvoidstring rowIdCollapses a row (when multiple row groups are applied).Args: string rowId - The id of the row to collapse. Can be retrieved from the "rows" collection.
CollapseRowvoidint rowIdCollapses a row (when multiple row groups are applied).Args: int rowId - The id of the row to collapse. Can be retrieved from the "rows" collection.
ExpandAllRowsvoidN/AExpands all rows (when multiple row groups are applied).
ExpandRowvoidobject rowIdExpands a row (when multiple row groups are applied).Args: string rowId - The id of the row to expand. Can be retrieved from the "rows" collection.
ExpandRowvoidstring rowIdExpands a row (when multiple row groups are applied).Args: string rowId - The id of the row to expand. Can be retrieved from the "rows" collection.
ExpandRowvoidint rowIdExpands a row (when multiple row groups are applied).Args: int rowId - The id of the row to expand. Can be retrieved from the "rows" collection.
ExportDataobjectstring dataFormat, string fileName, Action<object> callbackExports the PivotTable's data.Args: string dataFormat - The file format to export to. Supported formats: 'csv', 'html', 'json', 'pdf', 'tsv', 'xlsx', 'xml'.,string fileName - The name of the file to export to,Action<object> callback - A callback function to pass the exported data to (if fileName is not provided)
ExportDataobjectstring dataFormat, string fileNameExports the PivotTable's data.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetDynamicColumnsIEnumerable<object>N/AReturns the current dynamic pivot columns.
GetSelectionIEnumerable<object>N/AReturns an array of selected row ids (when "selectionMode" is "'many'" or "'extended'") or an array of selected cell details (when "selectionMode" is "'cell'").
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RefreshvoidN/ARefreshes the PivotTable.
RemoveFiltervoidstring dataFieldRemoves filters applied to a specific column.Args: string dataField - The column's data field.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
SelectvoidIEnumerable<object> rowId, string dataFieldSelects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: IEnumerable<object> rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
SelectvoidIEnumerable<object> rowIdSelects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).
Selectvoidstring rowId, string dataFieldSelects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: string rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
Selectvoidstring rowIdSelects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).
Selectvoidint rowId, string dataFieldSelects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: int rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
Selectvoidint rowIdSelects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).
SortByvoidobject columnDefinition, string sortOrderSorts by a summary or group column.Args: object columnDefinition - The dynamic column's definition. Can be retrieved from the method "getDynamicColumns".,string sortOrder - Sort order. Possible values: 'asc' (ascending), 'desc' (descending), and null (removes sorting by column). If not provided, toggles the sorting.
SortByvoidobject columnDefinitionSorts by a summary or group column.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
UnselectvoidIEnumerable<object> rowId, string dataFieldUnselects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: IEnumerable<object> rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
UnselectvoidIEnumerable<object> rowIdUnselects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).
Unselectvoidstring rowId, string dataFieldUnselects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: string rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
Unselectvoidstring rowIdUnselects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).
Unselectvoidint rowId, string dataFieldUnselects one or more rows (when "selectionMode" is "'many'" or "'extended'") or a single cell (when "selectionMode" is "'cell'" and the second argument is passed).Args: int rowId - The id of the row (or an array of row ids) to select (or of the cell's parent row when "selectionMode" is "'cell'"). Can be retrieved from the "rows" collection.,string dataField - The dataField of the dynamic column (can be retrieved by calling "getDynamicColumns") of the cell to select (only applicable when "selectionMode" is "'cell'").
Unselectvoidint rowIdUnselects one or more rows (when selectionMode is 'many' or 'extended') or a single cell (when selectionMode is 'cell' and the second argument is passed).

PivotTable Events

NameTypeDescriptionEvent Detail
OnCellClickEventCallback<Event>This event is triggered when a cell has been clicked.string dataField- The data field of the cell's dynamic column., dynamic row- The data of the cell's row.
CellClickedevent PivotTableCellClickedEventHandlerThis event is triggered when a cell has been clicked.PivotTableCellClickedEventArgs
OnChangeEventCallback<Event>This event is triggered when the selection is changed.dynamic type- The type of action that initiated the selection change. Possible types: 'programmatic', 'interaction', 'remove'.
Changedevent PivotTableChangedEventHandlerThis event is triggered when the selection is changed.PivotTableChangedEventArgs
OnColumnClickEventCallback<Event>This event is triggered when a summary column header cell has been clicked.dynamic columnDefinition- An object detailing the clicked dynamic column., string dataField- The data field of the cell's original column.
ColumnClickedevent PivotTableColumnClickedEventHandlerThis event is triggered when a summary column header cell has been clicked.PivotTableColumnClickedEventArgs
OnCollapseEventCallback<Event>This event is triggered when a row has been collapsed.dynamic record- The (aggregated) data of the collapsed row.
Collapsedevent PivotTableCollapsedEventHandlerThis event is triggered when a row has been collapsed.PivotTableCollapsedEventArgs
OnCollapseTotalColumnEventCallback<Event>This event is triggered when a total column has been collapsed.dynamic columnDefinition- The definition of the collapsed total column.
CollapseTotalColumnedevent PivotTableCollapseTotalColumnedEventHandlerThis event is triggered when a total column has been collapsed.PivotTableCollapseTotalColumnedEventArgs
OnExpandEventCallback<Event>This event is triggered when a row has been expanded.dynamic record- The (aggregated) data of the expanded row.
Expandedevent PivotTableExpandedEventHandlerThis event is triggered when a row has been expanded.PivotTableExpandedEventArgs
OnExpandTotalColumnEventCallback<Event>This event is triggered when a total column has been expanded.dynamic columnDefinition- The definition of the expanded total column.
ExpandTotalColumnedevent PivotTableExpandTotalColumnedEventHandlerThis event is triggered when a total column has been expanded.PivotTableExpandTotalColumnedEventArgs
OnFilterEventCallback<Event>This event is triggered when a filtering-related action is made.dynamic action- The filtering action. Possible actions: 'add', 'remove'., dynamic filters- The added filters. Only when action is 'add'.
Filteredevent PivotTableFilteredEventHandlerThis event is triggered when a filtering-related action is made.PivotTableFilteredEventArgs
OnSortEventCallback<Event>This event is triggered when a column header cell has been clicked.dynamic columns- An array with information about the dynamic columns the PivotTable has been sorted by.
Sortedevent PivotTableSortedEventHandlerThis event is triggered when a column header cell has been clicked.PivotTableSortedEventArgs

Enums

PivotTableColumnAlign

PivotTableColumnAlign.Center
PivotTableColumnAlign.Left
PivotTableColumnAlign.Right

PivotTableColumnDataType

PivotTableColumnDataType.Boolean
PivotTableColumnDataType.Date
PivotTableColumnDataType.Number
PivotTableColumnDataType.String

PivotTableColumnSummary

PivotTableColumnSummary.Avg
PivotTableColumnSummary.Count
PivotTableColumnSummary.Max
PivotTableColumnSummary.Median
PivotTableColumnSummary.Min
PivotTableColumnSummary.Product
PivotTableColumnSummary.Stdev
PivotTableColumnSummary.Stdevp
PivotTableColumnSummary.Sum
PivotTableColumnSummary.Var
PivotTableColumnSummary.Varp

PivotTableColumnTotalsPosition

PivotTableColumnTotalsPosition.Near
PivotTableColumnTotalsPosition.Far

PivotTableConditionalFormattingCondition

PivotTableConditionalFormattingCondition.Between
PivotTableConditionalFormattingCondition.Equal
PivotTableConditionalFormattingCondition.GreaterThan
PivotTableConditionalFormattingCondition.LessThan
PivotTableConditionalFormattingCondition.NotEqual

PivotTableConditionalFormattingFontFamily

PivotTableConditionalFormattingFontFamily.ThedefaultfontFamilyassetinCSS
PivotTableConditionalFormattingFontFamily.Arial
PivotTableConditionalFormattingFontFamily.CourierNew
PivotTableConditionalFormattingFontFamily.Georgia
PivotTableConditionalFormattingFontFamily.TimesNewRoman
PivotTableConditionalFormattingFontFamily.Verdana

PivotTableConditionalFormattingFontSize

PivotTableConditionalFormattingFontSize.Eightpx
PivotTableConditionalFormattingFontSize.Ninepx
PivotTableConditionalFormattingFontSize.Tenpx
PivotTableConditionalFormattingFontSize.Elevenpx
PivotTableConditionalFormattingFontSize.Twelvepx
PivotTableConditionalFormattingFontSize.Thirteenpx
PivotTableConditionalFormattingFontSize.Fourtheenpx
PivotTableConditionalFormattingFontSize.Fifteenpx
PivotTableConditionalFormattingFontSize.Sixteenpx

PivotTableDesignerPosition

PivotTableDesignerPosition.Near
PivotTableDesignerPosition.Far

PivotTableDrillDownDataExport

PivotTableDrillDownDataExport.Null
PivotTableDrillDownDataExport.Xlsx
PivotTableDrillDownDataExport.Pdf
PivotTableDrillDownDataExport.Html
PivotTableDrillDownDataExport.Json
PivotTableDrillDownDataExport.Csv
PivotTableDrillDownDataExport.Tsv
PivotTableDrillDownDataExport.Xml

PivotTableGroupLayout

PivotTableGroupLayout.Classic
PivotTableGroupLayout.Default

PivotTableRowTotalsPosition

PivotTableRowTotalsPosition.Near
PivotTableRowTotalsPosition.Far

PivotTableSelectionMode

PivotTableSelectionMode.Many
PivotTableSelectionMode.Extended
PivotTableSelectionMode.Cell

PivotTableSortMode

PivotTableSortMode.None
PivotTableSortMode.One
PivotTableSortMode.Many

PivotTableColumn Properties

NameTypeDefaultDescription
AlignPivotTableColumnAlignPivotTableColumnAlign.LeftSets or gets the header cell alignment for pivot and summary columns and cell alignment for row group columns.
AllowFilterbooltrueSets or gets whether the column can be filtered.
AllowPivotboolfalseSets or gets whether the column can be a pivot column.
AllowRowGroupboolfalseSets or gets whether the column can be a row group column.
AllowSortbooltrueSets or gets whether summary columns based on the column can be sorted.
DataFieldstring""Sets or gets the column's data source-bound field.
DataTypePivotTableColumnDataTypePivotTableColumnDataType.StringSets or gets the data type of the column's cells.
Labelstring""Sets or gets the column's displayed text (for example in summary column headers).
PivotboolfalseSets or gets whether the column is a pivot column. Data from pivot columns is represented as column hierarchy in the PivotTable.
RowGroupboolfalseSets or gets whether the column is a row group column. Data from row group columns is represented as rows in the PivotTable. If multiple row groups are set, row hierarchy is displayed based on the order of the row group columns in the columns array.
SummaryPivotTableColumnSummaryPivotTableColumnSummary.SumSets or gets the summary function to aggregate the column's data by and produce dynamic summary columns for each unique pivot data point. There must always be at least one summary column for the PivotTable to make sense. When columnTotals is enabled, all summary columns must have the same summary function set.
SummarySettingsobjectnew object()Sets or gets an object with settings for cells in summary columns. These settings are not applied if column formatFunction is also implemented.

PivotTableConditionalFormatting Properties

NameTypeDefaultDescription
Columnstring"all"The data field of a numeric column to format. Set 'all' to format all numeric columns.
ConditionPivotTableConditionalFormattingConditionPivotTableConditionalFormattingCondition.LessThanThe formatting condition.
FirstValueint0The value to compare by. When condition is 'between', this is the start (from) value.
FontFamilyPivotTableConditionalFormattingFontFamilyPivotTableConditionalFormattingFontFamily.ThedefaultfontFamilyassetinCSSThe fontFamily to apply to formatted cells.
FontSizePivotTableConditionalFormattingFontSizePivotTableConditionalFormattingFontSize.FourtheenpxThe fontSize to apply to formatted cells. The fontSize as set in CSS is used by default.
Highlightstring"The default backgroundColor as set in CSS"The background color to apply to formatted cells.
SecondValueint1When condition is 'between', this is the end (to) value. Otherwise, this value is not used.
Textstring"The default color as set in CSS"The text color to apply to formatted cells.