Creating a Hierarchical TreeDataGrid
There are two parts to any TreeDataGrid
:
- The "Source" which is defined in code and describes how your data model will map to the rows and columns of the
TreeDataGrid
- The control which can be instantiated from XAML or from code and describes how the
TreeDataGrid
will appear
The source is usually defined at the view model layer if you're using the MVVM pattern but can also be defined in code-behind. This introduction will assume that you're using the MVVM pattern.
This article assumes that you are using C# 10 and have nullable reference types enabled.
Installation
First follow the installation instructions, ensuring that you add the theme to your App.axaml
file.