How to Display Hierarchical Data Using .NET MAUI TreeGrid

11 min read
How to Display Hierarchical Data Using .NET MAUI TreeGrid

TL;DR: Explore how to display and manage hierarchical data in .NET MAUI using Syncfusion TreeGrid. This guide walks you through self-referential data binding, expandable rows, typed columns, and multi-column sorting, with a practical example of building a project task manager.

Consider a project management application that needs to display projects, phases, tasks, and subtasks. A standard data grid can show task details in rows and columns, but it does not naturally represent parent-child relationships. A tree view can display the hierarchy, but it does not provide the same tabular layout for comparing task details.

The Syncfusion® .NET MAUI TreeGrid brings these two approaches together. It displays hierarchical data in an expandable grid, allowing users to explore parent-child relationships while viewing related information in columns.

Introduced as a preview control in the 2026 Volume 3 release of Syncfusion Essential Studio®, the .NET MAUI TreeGrid supports both self-relational and nested-collection data binding. It also provides features such as typed columns, sorting, filtering, selection, and customization.

In this blog, you’ll build a project task manager using the TreeGrid. You’ll create a hierarchical data model, bind it to the control, configure different column types, and display expandable task records.

Project task manager built with the .NET MAUI TreeGrid
Project task manager built with the .NET MAUI TreeGrid

Why use a TreeGrid instead of a DataGrid or TreeView?

A DataGrid displays tabular data, while a TreeView displays hierarchical relationships. The .NET MAUI TreeGrid combines both, allowing you to display parent-child relationships alongside multiple data columns.

Here’s how they compare:

RequirementDataGridTreeViewTreeGrid
Multiple aligned data columnsYesNoYes
Expand and collapse parent-child nodesNoYesYes
Sorting and filtering across columnsYesLimitedYes
Typed columns (date, numeric, checkbox)YesNoYes

A TreeGrid is a good choice for applications such as project management tools, where users need to explore tasks and subtasks while viewing details such as priority, dates, and completion status.

Common use cases

The TreeGrid is useful in applications that need to display and explore hierarchical information.

  • Project management: Display projects, phases, tasks, and subtasks.
  • Organization charts: Show employees, managers, and departments.
  • Inventory management: Organize categories, products, and variants.
  • Financial reporting: Display hierarchical accounts and support rollup analysis.
  • Analytics dashboards: Explore reports through hierarchical business dimensions.

Key features of the .NET MAUI TreeGrid

The .NET MAUI TreeGrid provides several features for displaying and working with hierarchical data.

  • Hierarchical data display: Display parent-child relationships in an expandable structure. The control supports self-relational data and nested collections.
  • Data binding and MVVM support: Integrate with the .NET MAUI MVVM pattern using data-binding mechanisms such as ObservableCollection and INotifyPropertyChanged.
  • Typed columns: Use text, numeric, date, checkbox, and template columns to display different types of data.
  • Data operations: Support multi-column sorting, filtering, and selection to help users explore hierarchical records.
  • Styling and customization: Customize the appearance with conditional formatting, frozen columns, and built-in themes, including Material, Cupertino, and Fluent.
Display Hierarchical Data Faster with .NET MAUI TreeGrid

Show parent-child records in an expandable grid with Syncfusion .NET MAUI TreeGrid. Use self-referential or nested-collection binding, typed columns, sorting, filtering, selection, and built-in themes in your .NET MAUI apps.

Explore .NET MAUI TreeGrid

Prerequisites

Before building the application, make sure you have:

  • .NET 10 or later with the .NET MAUI workload installed.
  • Visual Studio with .NET MAUI support or Visual Studio Code with the .NET MAUI extension.
  • Syncfusion .NET MAUI controls version 35.1.37 or later.
  • A valid Syncfusion license key.

If the MAUI workload is not installed, run:

dotnet workload install maui

This walkthrough uses Syncfusion package version 35.1.37.

Getting started with the .NET MAUI TreeGrid

Let’s build a simple task manager application to understand how the TreeGrid works. The application will display project tasks in a hierarchy, with each task containing details such as its title, priority, dates, progress, and completion status.

We’ll complete the implementation in the following steps:

  1. Create a .NET MAUI project.
  2. Install the TreeGrid NuGet package.
  3. Register the Syncfusion license and configure the application.
  4. Create a data model.
  5. Populate the ViewModel with hierarchical task data.
  6. Display the data using the TreeGrid.

Create a new .NET MAUI project

Start by creating a new .NET MAUI application using the .NET CLI:

dotnet new maui -n TreeGridGettingStarted
cd TreeGridGettingStarted

This creates the project structure for the application.

Install the TreeGrid NuGet package

Install the Syncfusion .NET MAUI TreeGrid package using the following command:

dotnet add package Syncfusion.Maui.TreeGrid

The package adds the TreeGrid control and its required dependencies to the project.

Register the Syncfusion license and configure the handler

Before using Syncfusion controls, register your license key and configure the Syncfusion core handler in MauiProgram.cs.

Add the following namespaces:

using Syncfusion.Licensing;
using Syncfusion.Maui.Core.Hosting;

Then, update the CreateMauiApp method:

namespace TreeGridGettingStarted;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        // Register your Syncfusion license key.
        SyncfusionLicenseProvider.RegisterLicense("YOUR_LICENSE_KEY");

        var builder = MauiApp.CreateBuilder();

        builder
            .UseMauiApp<App>()
            .ConfigureSyncfusionCore()

        return builder.Build();
    }
}

Replace YOUR_LICENSE_KEY with your actual Syncfusion license key.

Note: Register the license during application initialization, before the Syncfusion controls are initialized.

Create the data model

Next, create a model to represent the project tasks. Each task needs a unique identifier and a parent identifier to establish its position in the hierarchy.

Create a ProjectTask.cs file in the Model folder:

namespace TreeGridGettingStarted.Model;

public class ProjectTask
{
    public int TaskID { get; set; }
    public int? ParentID { get; set; }
    public string Title { get; set; } = string.Empty;
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public int Progress { get; set; }
    public bool IsCompleted { get; set; }
    public string Priority { get; set; } = string.Empty;
}

The important properties for establishing the hierarchy are:

  • TaskID: A unique identifier for each task.
  • ParentID: The identifier of the task’s parent.

For example, a project can have a TaskID of 1001. Its child tasks use 1001 as their ParentID. This relationship allows the TreeGrid to identify which records belong under the project.

For this example, root-level tasks use -1 as their ParentID, which will later be configured as the TreeGrid’s root value.

Create a ViewModel and populate the task data

Now, create a ViewModel to hold the task records. We’ll use ObservableCollection<ProjectTask> to store the data and implement INotifyPropertyChanged to notify the UI when the collection property changes.

Create a TaskViewModel.cs file in the ViewModel folder:

using System.Collections.ObjectModel;
using System.ComponentModel;
using TreeGridGettingStarted.Model;

namespace TreeGridGettingStarted.ViewModel;

public class TaskViewModel : INotifyPropertyChanged
{
    private ObservableCollection<ProjectTask> _tasks =
        new ObservableCollection<ProjectTask>();

    public ObservableCollection<ProjectTask> Tasks
    {
        get => _tasks;
        set
        {
            _tasks = value;
            OnPropertyChanged(nameof(Tasks));
        }
    }

    public TaskViewModel()
    {
        Tasks = new ObservableCollection<ProjectTask>
        {
            new ProjectTask
            {
                TaskID = 1001,
                ParentID = -1,
                Title = "Project Initiation",
                StartDate = new DateTime(2025, 10, 1),
                EndDate = new DateTime(2026, 1, 15),
                Progress = 100,
                IsCompleted = true,
                Priority = "High"
            },
            new ProjectTask
            {
                TaskID = 1002,
                ParentID = 1001,
                Title = "Requirements Gathering",
                StartDate = new DateTime(2025, 10, 1),
                EndDate = new DateTime(2026, 1, 5),
                Progress = 100,
                IsCompleted = true,
                Priority = "High"
            },
            new ProjectTask
            {
                TaskID = 1003,
                ParentID = 1001,
                Title = "Feasibility Analysis",
                StartDate = new DateTime(2025, 10, 15),
                EndDate = new DateTime(2026, 1, 10),
                Progress = 100,
                IsCompleted = true,
                Priority = "Medium"
            },
            new ProjectTask
            {
                TaskID = 1004,
                ParentID = 1001,
                Title = "Architecture Design",
                StartDate = new DateTime(2025, 11, 1),
                EndDate = new DateTime(2026, 1, 15),
                Progress = 100,
                IsCompleted = true,
                Priority = "High"
            },
            new ProjectTask
            {
                TaskID = 1080,
                ParentID = -1,
                Title = "Training & Adoption",
                StartDate = new DateTime(2025, 11, 1),
                EndDate = new DateTime(2026, 8, 31),
                Progress = 15,
                IsCompleted = false,
                Priority = "Medium"
            },
            new ProjectTask
            {
                TaskID = 1081,
                ParentID = 1080,
                Title = "Training Materials",
                StartDate = new DateTime(2025, 11, 15),
                EndDate = new DateTime(2026, 4, 30),
                Progress = 50,
                IsCompleted = false,
                Priority = "Medium"
            },
            new ProjectTask
            {
                TaskID = 1082,
                ParentID = 1080,
                Title = "Internal Workshops",
                StartDate = new DateTime(2025, 12, 1),
                EndDate = new DateTime(2026, 5, 31),
                Progress = 20,
                IsCompleted = false,
                Priority = "Low"
            }
        };
    }

    public event PropertyChangedEventHandler? PropertyChanged;

    private void OnPropertyChanged(string propertyName)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

Each task is connected to its parent through the ParentID property. For example, tasks 1002, 1003, and 1004 belong to the parent task 1001. Similarly, tasks 1081 and 1082 belong to task 1080.

The ObservableCollection helps notify the UI when items are added to or removed from the collection. The ViewModel’s INotifyPropertyChanged implementation notifies the UI when the Tasks property itself is replaced.

If your application also needs to update individual task properties at runtime and reflect those changes in the UI, implement INotifyPropertyChanged in the ProjectTask model as well.

Display the data in the TreeGrid

With the data model and ViewModel ready, add the TreeGrid to MainPage.xaml.

First, set the page’s BindingContext to TaskViewModel and bind the Tasks collection to the TreeGrid using its ItemsSource property.

For self-referential data binding, configure the following properties:

  • ParentPropertyName: Identifies the property containing the unique ID of each record.
  • ChildPropertyName: Identifies the property containing the parent record’s ID.
  • SelfRelationRootValue: Specifies the value used to identify root-level records.

Add the following XAML to MainPage.xaml:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:syncfusion="clr-namespace:Syncfusion.Maui.TreeGrid;assembly=Syncfusion.Maui.TreeGrid"
             xmlns:local="clr-namespace:TreeGridGettingStarted.ViewModel"
             x:Class="TreeGridGettingStarted.MainPage">

    <ContentPage.BindingContext>
        <local:TaskViewModel />
    </ContentPage.BindingContext>

    <Grid Padding="12">
        <syncfusion:SfTreeGrid ItemsSource="{Binding Tasks}"
                               AutoGenerateColumnsMode="None"
                               ChildPropertyName="TaskID"
                               ParentPropertyName="ParentID"
                               SelfRelationRootValue="-1"
                               SortingMode="Multiple">

            <syncfusion:SfTreeGrid.Columns>

                <!-- Text columns -->
                <syncfusion:TreeGridTextColumn MappingName="TaskID"
                                               HeaderText="ID" />
                <syncfusion:TreeGridTextColumn MappingName="Title"
                                               HeaderText="Description" />
                <syncfusion:TreeGridTextColumn MappingName="Priority"
                                               HeaderText="Priority" />

                <!-- Date columns -->
                <syncfusion:TreeGridDateColumn MappingName="StartDate"
                                               HeaderText="Start Date"
                                               Format="MMM dd, yyyy" />
                <syncfusion:TreeGridDateColumn MappingName="EndDate"
                                               HeaderText="Target Date"
                                               Format="MMM dd, yyyy" />

                <!-- Numeric column -->
                <syncfusion:TreeGridNumericColumn MappingName="Progress"
                                                  HeaderText="Progress (%)"
                                                  Format="N0" />

                <!-- Checkbox column -->
                <syncfusion:TreeGridCheckBoxColumn MappingName="IsCompleted"
                                                   HeaderText="Completed" />

            </syncfusion:SfTreeGrid.Columns>
        </syncfusion:SfTreeGrid>
    </Grid>
</ContentPage>

Let’s look at the important settings:

  • ItemsSource: Binds the TreeGrid to the Tasks collection in the ViewModel.
  • AutoGenerateColumnsMode="None": Disables automatic column generation because the columns are defined explicitly.
  • ChildPropertyName: Specifies the task ID property used in the self-referential relationship.
  • ParentPropertyName: Specifies the property containing the parent task ID.
  • SelfRelationRootValue="-1": Identifies records whose parent ID is -1 as root-level records.
  • SortingMode="Multiple": Enables sorting by multiple columns.

The column definitions control how each task property appears:

Column typePropertyPurpose
TreeGridTextColumnTaskID, Title, PriorityDisplays text-based task details.
TreeGridDateColumnStartDate, EndDateDisplays dates using the specified format.
TreeGridNumericColumnProgressDisplays numeric progress values.
TreeGridCheckBoxColumnIsCompletedDisplays task completion status as a checkbox.

You can define the columns explicitly to control their headers, mapped properties, and display formats. This is useful when different data types need different presentation styles.

Run the application. The TreeGrid displays the project tasks in an expandable hierarchy. Users can expand or collapse parent tasks to explore their associated child tasks while viewing the task details in aligned columns.

Displaying hierarchical project tasks in the .NET MAUI TreeGrid
Displaying hierarchical project tasks in the .NET MAUI TreeGrid

Binding options: Self-referential vs. nested collections

The TreeGrid supports two approaches to binding hierarchical data. Choose the approach that matches how your application stores its data.

Self-referential data binding

In self-referential binding, all records are stored in a single collection. Each record contains an identifier and a parent identifier that establishes its relationship with another record.

For example:

new ProjectTask
{
    TaskID = 1001,
    ParentID = -1,
    Title = "Project Initiation"
};

new ProjectTask
{
    TaskID = 1002,
    ParentID = 1001,
    Title = "Requirements Gathering"
};

Here, task 1002 is a child of task 1001 because its ParentID matches the parent’s TaskID.

This approach works well when data comes from flat sources such as database tables or APIs that return records with parent identifiers.

Nested-collection data binding

In nested-collection binding, each parent object contains a collection of its child objects. The hierarchy is represented directly in the object model rather than through separate parent ID fields.

For example, a project object can contain a collection of phases, and each phase can contain its own collection of tasks.

This approach is suitable when your application already stores hierarchical data as an object graph.

Which approach should you choose?

  • Use self-referential binding when your data is stored in a flat collection with parent and child identifiers.
  • Use nested-collection binding when your objects already contain child collections.

Both approaches let you display hierarchical data. The right choice depends on your existing data structure.

Supercharge your cross-platform apps with Syncfusion's robust .NET MAUI controls.

Conclusion

The Syncfusion .NET MAUI TreeGrid provides a practical way to display hierarchical data in a familiar grid layout. It combines expandable parent-child relationships with typed columns, sorting, filtering, and customization.

In this walkthrough, you built a project task manager using self-referential data binding, configured the TreeGrid columns, and displayed tasks in an expandable hierarchy. You also explored the difference between self-referential and nested-collection binding.

You can use the same approach in project management tools, organization charts, inventory applications, and other .NET MAUI applications that work with hierarchical data.

Get started with Syncfusion .NET MAUI TreeGrid

The .NET MAUI TreeGrid is available as a preview control in the Essential Studio 2026 Volume 3 release.

Explore the GitHub sample to see the control in action, and refer to the .NET MAUI TreeGrid documentation for additional configuration options and API details.

New to Syncfusion? Start a 30-day free trial or check your eligibility for a Community License.

Googleplay 2x
Microsoft 2x
Github 2x

Frequently Asked Questions

1. What is the difference between self-referential and nested-collection binding in .NET MAUI TreeGrid?

Self-referential binding stores parent-child relationships through identifier properties such as TaskID and ParentID. It is useful for flat datasets, such as records retrieved from a database.

Nested-collection binding stores child records inside a collection property of the parent object. It works well when your data is already organized as a hierarchy of objects.

2. How do I identify root-level records in a .NET MAUI TreeGrid?

Use the SelfRelationRootValue property to specify the value that identifies root-level records. In this example, records with ParentID = -1 are treated as root nodes.

SelfRelationRootValue="-1"

Make sure this value matches the parent ID value assigned to your root records.

3. Can I define custom columns in the .NET MAUI TreeGrid?

Yes. You can define columns explicitly and map them to properties in your data model. The TreeGrid supports text, numeric, date, checkbox, and template columns, allowing you to display different data types in the same grid.

4. Can users expand and collapse TreeGrid nodes programmatically?

Yes. The TreeGrid supports expanding and collapsing hierarchical nodes through its API. This allows developers to control node visibility based on application requirements, in addition to letting users interact with the hierarchy in the UI.

Refer to the TreeGrid API documentation for the available expansion and collapse methods.

5. Does the .NET MAUI TreeGrid support sorting by multiple columns?

Yes. The TreeGrid supports multi-column sorting. You can enable it by setting SortingMode="Multiple". This allows users to sort hierarchical data using more than one column.

Farjana Parveen

Farjana Parveen is a product manager at Syncfusion who oversees the development of the DataGrid, TreeGrid, and TreeView WPF and also WinUI controls. She has been a .NET developer since 2014, with expertise in WinUI, WinForms, and WPF.

More posts by Farjana Parveen

Display Hierarchical Data Faster with .NET MAUI TreeGrid

Show parent-child records in an expandable grid with Syncfusion .NET MAUI TreeGrid. Use self-referential or nested-collection binding, typed columns, sorting, filtering, selection, and built-in themes in your .NET MAUI apps.

Explore .NET MAUI TreeGrid