This guide configures TreeDataGrid in an Avalonia project and verifies that it renders correctly.
dotnet add package TreeDataGrid.Controls.Avalonia
If you use PackageReference directly:
<ItemGroup>
<PackageReference Include="TreeDataGrid.Controls.Avalonia" Version="*" />
</ItemGroup>
The Avalonia UI package uses these distribution identities:
TreeDataGrid.Controls.AvaloniaTreeDataGrid.Avalonia.dllavares://TreeDataGrid.Avalonia/Add the style include 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://TreeDataGrid.Avalonia/Themes/Fluent.axaml"/>
</Application.Styles>
</Application>
Existing applications may keep the compatibility TreeDataGrid package and its
avares://Avalonia.Controls.TreeDataGrid/... URI. Do not reference both UI packages
in one application. See Package and Assembly.
Add a minimal control instance to any window:
<TreeDataGrid />
Run the app. If styling is loaded correctly, the control template is applied (not a plain empty rectangle).
When available, bind Source to your view model:
<TreeDataGrid Source="{Binding Source}" />
Then proceed to:
If setup still fails after installation, use the checks below.
Cause: missing StyleInclude in App.axaml.
Fix: ensure this exists:
<StyleInclude Source="avares://TreeDataGrid.Avalonia/Themes/Fluent.axaml"/>
Cause: DataContext or Source binding is null.
Fix: verify:
DataContext is setSource property exists and is initializedTreeDataGrid Source="{Binding Source}" path matches property name