Reputation: 63
I'm trying to use the Avalonia TreeGridView but can't figure out how to use it in an object with a different object collection. https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid The example provided on the Docs is as follows:
public class Person
{
//some properties
ObservableCollection<Person> People{get;set;}
}
The class that I'm using is
public class Department
{
//some properties
ObservableCollection<SubDepartment> SubDepartments{get;set}
}
Is this possible?
Upvotes: 1
Views: 850
Reputation: 41
Yes, there is actually a way to use TreeDataGrid. Basically, you need to create another type of collection called FlatTreeDataGridSource.
public FlatTreeDataGridSource<SubDepartment> SubDepartments { get; set; }
Using this collection, you need to define columns such as TextColumn, CheckBoxColumn or TemplateColumn. Good luck using it!
Upvotes: 0