The Avalonia Pivot Grid That Runs on Avalonia 12

sgcPivotGrid gives your Avalonia application a real pivot table: a pivot grid, a drag and drop field list and pivot charts, as native Avalonia 12 controls on Windows, Linux and macOS. Bind it to your view model in XAML, let users drag fields between rows, columns, filters and values, and export the result to Excel. There is no WPF runtime underneath and no OLAP server to install.

A Pivot Table Made for Avalonia

Pivot grids for .NET desktop apps usually come from WinForms and WPF suites. On Avalonia, the choice is small.

Native, not emulated

TsgcAvaloniaPivotGrid and TsgcAvaloniaPivotFieldList live in the esegece.sgcPivotGrid.Avalonia package. They are built on the sgcUICore Avalonia control base and drawn with SkiaSharp, so they run wherever Avalonia 12 runs on the desktop. The package floor is Avalonia 12.0 and the tests and demos run on 12.1.4.

An alternative to an OLAP stack

The engine pivots the rows you already have in memory. It keeps every column in a typed column store, aggregates in one pass over the source rows and draws only the visible part of the result. Totals come from the source values, never from averages of averages.

Everything Users Expect From a Pivot Table

Features marked Registered are not in the free Community package. Every other feature is in every edition.

Feature On the Avalonia pivot grid Edition
Field list with drag and dropTsgcAvaloniaPivotFieldList with the Rows, Columns, Filters and Values zones, DeferUpdate and ApplyChanges, a member popup with search, and a Group by menu (None, Year, Quarter, Month, Week, Day) on date fieldsevery edition
AggregationsSum, Count, Average, Min, Max, distinct count, standard deviation and variance (pvfSum to pvfVar), with subtotals and grand totalsevery edition
Date groupingDateGrouping with pvdYear, pvdQuarter, pvdMonth, pvdWeek and pvdDay, one level per fieldevery edition
Filters and sortingmember, label and value filters, sort by label or by valueevery edition
Top NTopN and TopNOthers on a field: keep the top items and sum the rest into OthersRegistered
Show values asShowAs: percent of row, of column or of the grand total, running total, difference from and rankRegistered
Calculated fields and itemsCalculatedFields on the engine, and CalculatedItems on a field for formulas over sibling items such as East+West; totals stay based on the source rowsRegistered
Asynchronous calculationAsyncCalculation, RecalculateAsync returning a Task<bool> with a CancellationToken, and CancelCalculation, so the window stays responsiveRegistered
Conditional formatting and drill downFormatRules for colour scales, OnGetCellStyle, OnGetCellText and OnDrillDown for the rows behind a cellevery edition
ExportSaveToCSV, SaveToHTML, SaveToJSON, SaveToPNG and SaveToSVGevery edition
Excel exportSaveToXLSX writes a real workbook with no external library: merged headers, outline, frozen header, number formats and right to left sheetsRegistered
Pivot chartsTsgcPivotChartTable feeds a TsgcChartTableLink of sgcCharts on a TsgcAvaloniaChart, the field list with Layout = pvlBar puts field buttons above the chart, and the chart designer opens with ShowDesignerAsyncRegistered sgcPivotGrid and sgcCharts
Ask the pivotTsgcPivotGridAI turns a question in plain language into a pivot layout through any TsgcUIAIProvider, with the TsgcAvaloniaAIQueryBar. Only the field catalog is sent (names, captions, types and a few sample values), never the rowsevery edition; Undo is Registered
Saved layoutsSaveLayoutToString, LoadLayoutFromString, SaveLayoutToFile and LoadLayoutFromFile; the chart settings in the pivot layout JSON are byte compatible with DelphiRegistered
Printing and PDFPrint, ShowPrintPreview and ExportToPDF, with the headers on every page; the PDF is a tagged PDF/UA document where the pivot becomes a real tableevery edition
Themeslight, dark and high contrast themes, and the Fluent preset; under Fluent, Avalonia 12 with FluentTheme gives the controls their backgrounds, borders, text and fillsevery edition
Right to left and accessibilityright to left layouts driven by the direction Avalonia already has, and UI Automation on by defaultevery edition
Languagesend user texts from embedded language packs for 12 languages, switched with sgcUILang.SetLanguageevery edition

XLSX export, calculated items, asynchronous calculation, pivot charts and the 12 language packs are listed in the sgcUI .NET history for version 2026.11.0. For the full feature tour see the sgcPivotGrid product page.

A Pivot Grid in Avalonia XAML

Both files are copied from a sample Avalonia 12.1.4 app on net8.0 with compiled bindings and FluentTheme. It was built in Release against the sgcPivotGrid Avalonia sources with 0 errors and 0 warnings. RecalculateAsync and SaveToXLSX need the Registered edition and version 2026.11.

The view: grid, fields and field list

One sgc prefix maps every sgcUI control. The fields are the content of the grid, ItemsSource binds the rows, and the field list follows the grid through PivotGrid:

MainWindow.axaml
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sgc="https://www.esegece.com/sgcui"
        xmlns:vm="using:PivotDemo"
        x:Class="PivotDemo.MainWindow"
        x:DataType="vm:TSalesViewModel"
        Title="Avalonia pivot grid" Width="1100" Height="640">
  <Grid ColumnDefinitions="*,260">
    <sgc:TsgcAvaloniaPivotGrid x:Name="pivot" ItemsSource="{Binding Sales}" AlternateRows="True">
      <sgc:TsgcAvaloniaPivotField FieldName="Region" Area="pvaRow" Caption="Region"/>
      <sgc:TsgcAvaloniaPivotField FieldName="Date" Area="pvaColumn" DateGrouping="pvdYear" Caption="Year"/>
      <sgc:TsgcAvaloniaPivotField FieldName="Date" Area="pvaColumn" DateGrouping="pvdQuarter" Caption="Quarter"/>
      <sgc:TsgcAvaloniaPivotField FieldName="Amount" Area="pvaData" Aggregation="pvfSum"
                                  DisplayFormat="#,##0.00" Caption="Sales"/>
    </sgc:TsgcAvaloniaPivotGrid>
    <sgc:TsgcAvaloniaPivotFieldList Grid.Column="1" Margin="8,0,0,0" PivotGrid="{Binding #pivot}"/>
  </Grid>
</Window>

The view model and the code behind

An ObservableCollection of plain objects is enough. Every public member becomes a pivot column, and a change to the collection reloads the pivot after 100 ms:

MainWindow.axaml.cs
using System;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Controls;

namespace PivotDemo
{
    public sealed class TSale
    {
        public string Region { get; set; }
        public DateTime Date { get; set; }
        public double Amount { get; set; }
    }

    public sealed class TSalesViewModel
    {
        public ObservableCollection<TSale> Sales { get; } = new ObservableCollection<TSale>();
    }

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            TSalesViewModel oModel = new TSalesViewModel();
            oModel.Sales.Add(new TSale { Region = "North", Date = new DateTime(2026, 2, 3), Amount = 1250 });
            oModel.Sales.Add(new TSale { Region = "South", Date = new DateTime(2026, 5, 18), Amount = 980 });
            DataContext = oModel;
        }

        // Registered edition: recalculate on a worker thread, then save an Excel workbook
        private async Task DoExportAsync(CancellationToken aToken)
        {
            if (await pivot.Pivot.RecalculateAsync(aToken))
                pivot.SaveToXLSX("sales.xlsx", "Sales");
        }
    }
}

The rest of the app is the standard Avalonia desktop template: Avalonia.Desktop and Avalonia.Themes.Fluent, <FluentTheme/> in App.axaml, and the esegece.sgcPivotGrid.Avalonia package, or esegece.sgcPivotGrid.Avalonia.Community for the free edition. The Avalonia quick start in the help builds the same pivot in code with BeginLoad, DefineColumn, AppendRow and EndLoad.

One Pivot Engine, Every Desktop

The Avalonia pivot grid shares its engine, fields and layout format with the WinForms, WPF, VCL and FireMonkey versions.

Target Control Platforms
Avalonia 12, net8.0, net9.0, net10.0TsgcAvaloniaPivotGrid, TsgcAvaloniaPivotFieldListWindows, Linux and macOS
.NET Framework 4.7.2, .NET 8, 9 and 10TsgcWinFormsPivotGrid, TsgcWpfPivotGridWinForms and WPF on Windows
Delphi 7 to 13, VCLTsgcVCLPivotGridWin32 and Win64
Delphi XE6 to 13, FireMonkeyTsgcFMXPivotGridWindows, macOS, iOS and Android
C++ Builder 2007 to 13VCL and FMX pivot gridsgenerated .hpp headers and static libraries

Free to Start, Full Source When You Buy

Prices from the sgcUI pricing page.

Community

esegece.sgcPivotGrid.Avalonia.Community on NuGet, free in commercial and non-commercial projects for an individual or organisation with annual gross revenue under EUR 1,000,000 and no more than five developers. It has the grid, the field list, aggregations, date grouping, filters, colour scales, the CSV, HTML, JSON, PNG and SVG exports, printing and PDF.

sgcPivotGrid .NET

The single package, €249 per developer with full C# source code and 1 year of updates. It adds Top N with Others, show values as, calculated fields and items, saved layouts, XLSX export, asynchronous calculation and pivot charts, for WinForms, WPF and Avalonia.

sgcUI .NET Enterprise

Every sgcUI product for .NET, sgcPivotGrid included, from €699 per developer. The pivot charts also need sgcCharts, which is in Enterprise too.

Pivot on Avalonia: the Routes Compared

Read on 2026-10-20, from the pages linked in the table.

  A WPF suite pivot on Avalonia XPF Avalonia Pro sgcPivotGrid
Pivot gridthe WPF control, run by XPF, "a binary-compatible WPF runtime"not listed on the Avalonia Pro pagenative Avalonia 12 controls with a field list
LicenceXPF per application: Internal EUR 9,500, Business EUR 29,500, Enterprise from EUR 124,500EUR 899 per seat per year, excluding VATper developer, from €249, no per application fee, free binary redistribution
Conditionsthe XPF third party notes say Win32 API shims are "required for DevExpress controls" and that "Issues most commonly arise with controls that use GDI or WinForms components" the Avalonia package references Avalonia, Avalonia.Skia and SkiaSharp, not WPF or WinForms
Source code full source for premium controls in Enterprisefull C# source code in every Registered edition

XPF aims to run an existing WPF application on macOS and Linux with its code and controls largely as they are, and sgcPivotGrid does not do that: you add it to an Avalonia view. If you are moving a WPF or WinForms app, read WinForms and WPF to Avalonia. If you use Avalonia Pro, read the controls Avalonia Pro does not ship; sgcPivotGrid runs next to the Avalonia Pro controls.

Run It Before You Write a Line

The .NET demos of sgcPivotGrid include two Avalonia apps that run on Windows, Linux and macOS with the .NET SDK 8.0 or newer.

SalesPivotAvalonia

100,000 generated sales rows with a field list, Year, Quarter and Month columns, sort by value, a colour scale, CSV, HTML and PNG export and the AI query bar. dotnet run starts it, and dotnet run -- --test result.txt runs its self checks off screen.

PivotChartAvalonia

A pivot chart as in Excel: a TsgcAvaloniaPivotGrid, a TsgcPivotChartTable and a TsgcChartTableLink on a TsgcAvaloniaChart, field buttons above the chart, the chart designer and the chart settings saved in the pivot layout. The pivot chart is Registered only.

Prefer a ready executable? The compiled demos of every sgcUI product need nothing installed.

Frequently Asked Questions

Yes. TsgcAvaloniaPivotGrid and TsgcAvaloniaPivotFieldList are Avalonia controls in the esegece.sgcPivotGrid.Avalonia package, built on the sgcUICore Avalonia control base and drawn with SkiaSharp. The package targets Avalonia 12 (package floor 12.0, tested on 12.1.4). There is no WPF layer and no XPF runtime.

Windows, Linux and macOS through Avalonia 12, with the target frameworks net8.0, net9.0 and net10.0. The same product also has WinForms and WPF pivot grids for .NET Framework 4.7.2 and .NET 8, 9 and 10, and VCL and FireMonkey pivot grids for Delphi and C++ Builder.

Bind ItemsSource to any IEnumerable of the view model, for example an ObservableCollection, a List or a DataView, and declare the fields in XAML as TsgcAvaloniaPivotField elements with FieldName, Area and Aggregation. Every member of the items becomes a pivot column. Later changes of the collection reload the pivot once per 100 ms window. A System.Data.DataTable can also be read through TsgcPivotSource_DataSet.

The Community package esegece.sgcPivotGrid.Avalonia.Community has the grid, the drag and drop field list, eight aggregations, date grouping, member, label and value filters, sorting, colour scales, CSV, HTML, JSON, PNG and SVG export, printing with a preview, PDF export, accessibility and AI layouts. Top N with Others, show values as, calculated fields and items, saved layouts, XLSX export, asynchronous calculation, pivot charts and Undo of an AI layout need a Registered edition.

Yes. The layout is saved as JSON with SaveLayoutToString or SaveLayoutToFile, and the chart settings stored in the pivot layout JSON are byte compatible with Delphi. Saved layouts are in the Registered edition.

Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Add a Pivot Table to Your Avalonia App

Start with the free Community package from NuGet, or take the Registered edition for every feature and full C# source code, and run the SalesPivotAvalonia demo next to your app.