TreeDataGrid can now be configured directly in XAML with ItemsSource and declarative columns. This is the recommended path when your columns, templates, and bindings naturally belong in markup.
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme/>
<StyleInclude Source="avares://Avalonia.Controls.TreeDataGrid/Themes/Fluent.axaml"/>
</Application.Styles>
</Application>
<TreeDataGrid ItemsSource="{Binding People}">
<TreeDataGridTextColumn Header="First Name"
Binding="{Binding FirstName}"/>
<TreeDataGridTextColumn Header="Last Name"
Binding="{Binding LastName}"/>
</TreeDataGrid>
Source InsteadUse the code-behind Source approach when you need:
Filter and RefreshFilterExpand, Collapse, ExpandAll, and CollapseAll