TreeDataGrid 11.3.12.1
See the version list below for details.
dotnet add package TreeDataGrid --version 11.3.12.1
NuGet\Install-Package TreeDataGrid -Version 11.3.12.1
<PackageReference Include="TreeDataGrid" Version="11.3.12.1" />
<PackageVersion Include="TreeDataGrid" Version="11.3.12.1" />
<PackageReference Include="TreeDataGrid" />
paket add TreeDataGrid --version 11.3.12.1
#r "nuget: TreeDataGrid, 11.3.12.1"
#:package TreeDataGrid@11.3.12.1
#addin nuget:?package=TreeDataGrid&version=11.3.12.1
#tool nuget:?package=TreeDataGrid&version=11.3.12.1
TreeDataGrid for Avalonia
Introduction
TreeDataGrid is a control for the Avalonia UI framework which displays hierarchical and tabular data together in a single view. It is a combination of a TreeView and DataGrid control.
The control has two modes of operation:
- Hierarchical: data is displayed in a tree with optional columns
- Flat: data is displayed in a 2D table, similar to other
DataGridcontrols
An example of TreeDataGrid displaying hierarchical data:
An example of TreeDataGrid displaying flat data:
Current Status
We accept all issues and pull requests but we answer and review only pull requests and issues that are high quality and align with project scope.
Quick Start
Install the package:
dotnet add package TreeDataGrid
Or add a package reference:
<ItemGroup>
<PackageReference Include="TreeDataGrid" Version="x.y.z" />
</ItemGroup>
Add the theme to App.axaml:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="AvaloniaApplication.App">
<Application.Styles>
<FluentTheme/>
<StyleInclude Source="avares://Avalonia.Controls.TreeDataGrid/Themes/Fluent.axaml"/>
</Application.Styles>
</Application>
Basic Usage
Flat mode
using System.Collections.ObjectModel;
using Avalonia.Controls.Models.TreeDataGrid;
public class Person
{
public string? FirstName { get; set; }
public string? LastName { get; set; }
public int Age { get; set; }
}
public class MainWindowViewModel
{
private readonly ObservableCollection<Person> _people = new()
{
new() { FirstName = "Eleanor", LastName = "Pope", Age = 32 },
new() { FirstName = "Jeremy", LastName = "Navarro", Age = 74 },
};
public FlatTreeDataGridSource<Person> Source { get; }
public MainWindowViewModel()
{
Source = new FlatTreeDataGridSource<Person>(_people)
{
Columns =
{
new TextColumn<Person, string>("First Name", x => x.FirstName),
new TextColumn<Person, string>("Last Name", x => x.LastName),
new TextColumn<Person, int>("Age", x => x.Age),
},
};
}
}
Hierarchical mode
using System.Collections.ObjectModel;
using Avalonia.Controls.Models.TreeDataGrid;
public class Person
{
public string? FirstName { get; set; }
public string? LastName { get; set; }
public int Age { get; set; }
public ObservableCollection<Person> Children { get; } = new();
}
public class MainWindowViewModel
{
private readonly ObservableCollection<Person> _people = new();
public HierarchicalTreeDataGridSource<Person> Source { get; }
public MainWindowViewModel()
{
Source = new HierarchicalTreeDataGridSource<Person>(_people)
{
Columns =
{
new HierarchicalExpanderColumn<Person>(
new TextColumn<Person, string>("First Name", x => x.FirstName),
x => x.Children),
new TextColumn<Person, string>("Last Name", x => x.LastName),
new TextColumn<Person, int>("Age", x => x.Age),
},
};
}
}
Bind in XAML (both modes):
<TreeDataGrid Source="{Binding Source}" />
Build and Package
Build/test/pack the library project:
dotnet restore src/Avalonia.Controls.TreeDataGrid/Avalonia.Controls.TreeDataGrid.csproj
dotnet build src/Avalonia.Controls.TreeDataGrid/Avalonia.Controls.TreeDataGrid.csproj -c Release --no-restore
dotnet test tests/Avalonia.Controls.TreeDataGrid.Tests/Avalonia.Controls.TreeDataGrid.Tests.csproj -c Release
dotnet pack src/Avalonia.Controls.TreeDataGrid/Avalonia.Controls.TreeDataGrid.csproj -c Release -o artifacts/packages
Packages are generated in artifacts/packages (.nupkg and .snupkg).
Build Documentation
Build docs locally:
./build-docs.sh
Serve docs locally:
./serve-docs.sh
Generated docs output is written to _site.
Getting Started
- Installation
- Creating a flat
TreeDataGrid - Creating a hierarchical
TreeDataGrid - Supported column types
- Selection
License
- Main project license: licence.md
- Preserved original upstream license: LICENSE-AVALONIA
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- Avalonia (>= 11.0.0)
- System.Reactive (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TreeDataGrid:
| Package | Downloads |
|---|---|
|
OneWare.Essentials
Essentials Needed for One Ware Plugin Development |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 12.0.0-preview2 | 37 | 3/6/2026 |
| 12.0.0-preview1 | 35 | 3/3/2026 |
| 11.3.12.1 | 35 | 3/4/2026 |
| 11.3.12 | 86 | 3/3/2026 |