Implementing Syncfusion Blazor TreeGrid
The Syncfusion Blazor TreeGrid (SfTreeGrid<TValue>) renders hierarchical data in a tabular format with expand/collapse rows. It supports self-referential flat data (IdMapping/ParentIdMapping) and nested child collections, combined with a full suite of grid features including editing, filtering, sorting, virtualization, and export.
When to Use This Skill
- User needs a hierarchical/tree-structured data table in a Blazor app
- User mentions SfTreeGrid, TreeGrid, IdMapping, ParentIdMapping
- User needs parent-child rows with expand/collapse in a grid
- User needs CRUD operations on tree-structured data
- User needs to export, filter, sort, or page hierarchical data
- User needs to bind TreeGrid to a GraphQL API using
GraphQLAdaptor
- User is working with organizational charts, task hierarchies, bill of materials, file explorer-style data in grid form
- User migrating from flat DataGrid to hierarchical TreeGrid
- User setting up TreeGrid in a Blazor Web App, WASM, Server, or MAUI project
Trigger keywords: TreeGrid, Tree Grid, SfTreeGrid, hierarchical grid, parent-child grid, IdMapping, ParentIdMapping, tree data table, nested grid rows, Syncfusion Blazor tree, GraphQL TreeGrid, GraphQLAdaptor TreeGrid
🔒 Mandatory Key Rules
These rules govern how this skill MUST behave. They are mandatory and must be strictly followed.
1. Purpose and Responsibility
Your responsibility is to interpret any natural‑language user request and provide accurate, complete, and validated information about all supported aspects of the Syncfusion Blazor TreeGrid, including:
- Public APIs
- Properties
- Events
- Features
- Behaviors
2. Accuracy and API Compliance
The Skill MUST:
- Use only officially supported Syncfusion TreeGrid features.
- NEVER invent APIs, methods, properties, events, behaviors, or future features.
- NEVER provide unsupported or hypothetical code samples.
- ALWAYS follow official Syncfusion component design patterns.
If a feature is not supported: clearly state the limitation and suggest a supported alternative when possible.
3. Interpreting Natural-Language Requests
When user requests are incomplete:
- Infer reasonable assumptions using official TreeGrid best practices.
- Fill missing gaps with accurate and relevant information.
- Request clarification only when essential.
4. Handling Unsupported User Requests
If the user asks for an unsupported capability:
- Explicitly state that it is not supported
- Suggest official alternatives or valid workarounds
- NEVER simulate or fabricate impossible functionality
5. Design Pattern Enforcement
The Skill MUST follow Syncfusion official patterns, including:
- Correct component structure (
SfTreeGrid, TreeGridColumn, TreeGridEditSettings, TreeGridEvents, etc.)
- Proper async event and API usage
- Valid configuration properties and enums
- Supported data‑binding approaches (self-referential, hierarchical, remote, custom adaptor, GraphQL)
- Real event patterns and names
6. Quality, Completeness & Reliability
The Skill MUST:
- Use only validated and real TreeGrid capabilities
- Provide actionable and implementation‑ready guidance
- Ensure clarity so users can follow without guesswork
- Maintain clean, readable, and professional formatting
7. No-Hallucination Safeguard
The Skill MUST NOT:
- Invent non‑existent APIs or behavior
- Suggest unsupported modes, features, or configuration
- Provide incorrect, misleading, or unverifiable code
- Describe undocumented internal behavior
If unsure: ask for clarification OR clearly state the limitation.
8. Event Name Verification Requirement
CRITICAL: Event names MUST be verified against references/events.md BEFORE providing code examples. All tree grid events MUST be defined inside the <TreeGridEvents> component
Common Mistakes to Avoid:
- ❌
OnSortChange — Does NOT exist. Use Sorting, Sorted instead
- ❌
OnFilterChange — Does NOT exist. Use Filtering, Filtered instead
Rule: ALWAYS cross-reference references/events.md for:
- Exact event names (case-sensitive)
- Event argument types (see Rule 11 for namespace resolution)
- Whether events are cancelable (✅ or ❌)
- When they fire (before/after operation)
9. Read Reference Files Before Writing Code
Before generating any code, identify every feature in the request and read the reference file for each one. The snippets in this file are abbreviated — they omit critical rules and known pitfalls. Reference files are the authoritative source.
⚠️ Read ALL reference files that apply — not just the one most obvious from the query.
10. Namespace and Type Resolution Rules
Rule 1: Always use full namespace qualification to avoid CS0104 "ambiguous reference" errors. Types exist in both Syncfusion.Blazor.TreeGrid and Syncfusion.Blazor.Grids namespaces.
Rule 2: Always include @using Syncfusion.Blazor.Grids; in _Imports.razor or component to prevent CS0103 "missing reference" errors for:
- Event argument types (
ActionEventArgs, RowDataBoundEventArgs, BeforeCopyPasteEventArgs, etc.)
- The
Action enum (Action.Sorting, Action.Save, etc.)
- Component classes (
TreeGridPageSettings, TreeGridFilterSettings, TreeGridSelectionSettings, etc.)
- Event handler support classes
Rule 3: The following event arg types belong to Syncfusion.Blazor.TreeGrid — add @using Syncfusion.Blazor.TreeGrid; (NOT Syncfusion.Blazor.Grids):
RowExpandingEventArgs<TValue>, RowExpandedEventArgs<TValue>
RowCollapsingEventArgs<TValue>, RowCollapsedEventArgs<TValue>
CheckBoxChangeEventArgs<TValue>
Type Reference:
| Type |
Namespace |
Example |
| FilterType |
TreeGrid |
Syncfusion.Blazor.TreeGrid.FilterType.Excel |
| EditMode |
TreeGrid |
Syncfusion.Blazor.TreeGrid.EditMode.Row |
| CopyHierarchyType |
TreeGrid |
Syncfusion.Blazor.TreeGrid.CopyHierarchyType.Both |
| Action |
Grids |
Syncfusion.Blazor.Grids.Action.Save |
| TextAlign |
Grids |
Syncfusion.Blazor.Grids.TextAlign.Right |
| ColumnType |
Grids |
Syncfusion.Blazor.Grids.ColumnType.Date |
| EditType |
Grids |
Syncfusion.Blazor.Grids.EditType.DatePickerEdit |
| SelectionMode |
Grids |
Syncfusion.Blazor.Grids.SelectionMode.Row |
| SelectionType |
Grids |
Syncfusion.Blazor.Grids.SelectionType.Multiple |
| ClipMode |
Grids |
Syncfusion.Blazor.Grids.ClipMode.Ellipsis |
| GridLine |
Grids |
Syncfusion.Blazor.Grids.GridLine.Horizontal |
| AggregateType |
Grids |
Syncfusion.Blazor.Grids.AggregateType.Sum |
| CellSelectionMode |
Grids |
Syncfusion.Blazor.Grids.CellSelectionMode.Box |
Component Overview
<SfTreeGrid DataSource="@TreeData"
IdMapping="TaskId"
ParentIdMapping="ParentId"
TreeColumnIndex="1"
AllowSorting="true"
AllowFiltering="true"
AllowPaging="true">
<TreeGridColumns>
<TreeGridColumn Field="TaskId" HeaderText="ID" Width="80" IsPrimaryKey="true" />
<TreeGridColumn Field="TaskName" HeaderText="Task Name" Width="200" />
<TreeGridColumn Field="Duration" HeaderText="Duration" Width="100" />
<TreeGridColumn Field="Progress" HeaderText="Progress" Width="100" />
</TreeGridColumns>
</SfTreeGrid>
Key concepts:
IdMapping — property name that uniquely identifies each row
ParentIdMapping — property name pointing to the parent row's ID (null/0 = root)
TreeColumnIndex — column index that shows the expand/collapse icon (0-based)
Navigation Guide
Setup & Getting Started
- Read: references/getting-started.md
- NuGet install,
_Imports.razor, Program.cs, theme/script setup, basic grid, IdMapping/ParentIdMapping/TreeColumnIndex, expand-collapse all, OnActionFailure
Data Binding
- Read: references/data-binding.md
- Self-referential flat data, hierarchical nested children, remote URL/OData/Web API,
SfDataManager, load on demand
- Read: references/custom-binding.md
DataAdaptor override, Read/ReadAsync, Insert/Update/Delete, paging & sorting support, self-referential only
- Read: references/graphql.md
- Hot Chocolate server,
GraphQLAdaptor, GraphQLAdaptorOptions, DataManagerRequestInput, CRUD mutations, cascading delete, CORS
Columns & Cells
- Read: references/columns.md
ColumnType, Format, TextAlign, frozen, reorder, resize, chooser, stacked headers, column menu, foreign key
- Read: references/cell.md
QueryCellInfo, CustomAttributes, ClipMode, GridLines, tooltips
Sorting, Filtering & Searching
- Read: references/sorting.md
AllowSorting, multi-sort, SortComparer, SortColumnAsync, ClearSortingAsync, hierarchy preserved
- Read: references/filtering.md
AllowFiltering, FilterType (FilterBar/Menu/Excel/CheckBox), hierarchy modes, operators, FilterByColumnAsync. ⚠️ See filtering.md for FilterTemplate rules
- Read: references/searching.md
- Toolbar Search,
SearchAsync, GridSearchSettings, hierarchy modes, highlight/clear
Editing
- Read: references/editing.md
- Edit modes (Cell/Row/Dialog/Batch), edit types, command column, validation, template editing, EF Core. ⚠️ See editing.md for
ValidationRules. Always add @using Syncfusion.Blazor.Grids when using <TreeGridEvents>
Rows & Selection
- Read: references/rows.md
RowDataBound, row/detail template, drag-and-drop, row height, row spanning
- Read: references/selection.md
- Row/cell/both modes, checkbox column, toggle, drag select, programmatic selection, touch
Paging & Virtualization
- Read: references/paging.md
AllowPaging, TreeGridPageSettings, PageSize, pager position/template, programmatic navigation
- Read: references/virtualization.md
EnableVirtualization, EnableColumnVirtualization, vs. paging, limitations
Toolbar, Menus & Templates
- Read: references/toolbar.md
- Built-in & custom items,
EnableToolbarItemsAsync, OnToolbarClick
- Read: references/context-menu.md
ContextMenuItems, custom items, ContextMenuItemClicked, conditional show/hide
- Read: references/templates.md
- Column/header/row/detail/toolbar templates, loading indicator
Exporting & Scrolling
- Read: references/exporting.md
ExportToExcelAsync, ExportToPdfAsync, PrintAsync, custom data/headers, themes
- Read: references/scrolling.md
- Frozen rows/columns (
FrozenRows, IsFrozen, FreezeDirection), AllowFreezeLineMoving, EnableStickyHeader, ScrollIntoViewAsync
Advanced Features
- Read: references/aggregates.md
TreeGridAggregateColumn (Field+Type required), AggregateType, FooterTemplate, ShowChildSummary, custom LINQ, page-scope limitation
- Read: references/clipboard.md
- Copy (Ctrl+C/Ctrl+Shift+H),
CopyAsync, paste (Box+Batch), CopyHierarchyMode, BeforeCopyPaste
- Read: references/autofill.md
EnableAutoFill + Cell/Box selection + Batch edit, limitations
- Read: references/adaptive-layout.md
EnableAdaptiveUI, full-screen dialogs, vertical row mode
- Read: references/state-management.md
EnablePersistence, persisted properties, manual state methods
Events
- Read: references/events.md
TreeGridEvents<TValue>, OnActionBegin/OnActionComplete, RowDataBound, QueryCellInfo, cancel actions
Quick Start Example
1. Install NuGet: Syncfusion.Blazor.TreeGrid
2. Register in _Imports.razor:
@using Syncfusion.Blazor
@using Syncfusion.Blazor.TreeGrid
3. Add CSS in wwwroot/index.html or App.razor:
<link href="_content/Syncfusion.Blazor.Themes/material.css" rel="stylesheet" />
4. Add to Program.cs:
builder.Services.AddSyncfusionBlazor();
5. Minimal component:
@using Syncfusion.Blazor.TreeGrid
<SfTreeGrid DataSource="@TreeData" IdMapping="Id" ParentIdMapping="ParentId" TreeColumnIndex="1">
<TreeGridColumns>
<TreeGridColumn Field="Id" HeaderText="ID" Width="80" IsPrimaryKey="true" />
<TreeGridColumn Field="Name" HeaderText="Name" Width="200" />
<TreeGridColumn Field="Status" HeaderText="Status" Width="120" />
</TreeGridColumns>
</SfTreeGrid>
@code {
public class TaskItem
{
public int Id { get; set; }
public int? ParentId { get; set; }
public string Name { get; set; }
public string Status { get; set; }
}
private List<TaskItem> TreeData = new()
{
new TaskItem { Id = 1, ParentId = null, Name = "Project Alpha", Status = "In Progress" },
new TaskItem { Id = 2, ParentId = 1, Name = "Design Phase", Status = "Done" },
new TaskItem { Id = 3, ParentId = 1, Name = "Development", Status = "In Progress" },
new TaskItem { Id = 4, ParentId = 3, Name = "Backend API", Status = "Pending" },
};
}
Common Patterns
Full-Featured TreeGrid (Sorting + Filtering + Paging + Editing)
<SfTreeGrid @ref="TreeGridRef"
DataSource="@TreeData"
IdMapping="Id"
ParentIdMapping="ParentId"
TreeColumnIndex="1"
AllowSorting="true"
AllowFiltering="true"
AllowPaging="true"
Toolbar="@(new List<string> { "Add", "Edit", "Delete", "Update", "Cancel" })">
<TreeGridEditSettings AllowAdding="true"
AllowEditing="true"
AllowDeleting="true"
Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
<TreeGridPageSettings PageSize="10" />
<TreeGridColumns>
<TreeGridColumn Field="Id" IsPrimaryKey="true" Visible="false" />
<TreeGridColumn Field="Name" HeaderText="Task" Width="220" />
<TreeGridColumn Field="Duration" HeaderText="Days" Width="100" />
<TreeGridColumn Field="Progress" HeaderText="%" Width="100" />
</TreeGridColumns>
</SfTreeGrid>
@code {
private SfTreeGrid<TaskItem> TreeGridRef;
// ... data and model
}
Excel & PDF Export
<SfTreeGrid @ref="TreeGridRef" AllowExcelExport="true" AllowPdfExport="true"
Toolbar="@(new List<string> { "ExcelExport", "PdfExport" })">
<TreeGridEvents TValue="TaskItem" />
...
</SfTreeGrid>
@code {
private SfTreeGrid<TaskItem> TreeGridRef;
private async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id.Contains("excelexport"))
await TreeGridRef.ExportToExcelAsync();
else if (args.Item.Id.Contains("pdfexport"))
await TreeGridRef.ExportToPdfAsync();
}
}
1---
2name: syncfusion-blazor-treegrid
3description: Implements the Syncfusion Blazor TreeGrid (SfTreeGrid) for hierarchical or self‑referential data with expandable nodes and nested row structures. Use this skill when building tree‑view workflows in Blazor Server, WebAssembly, Web App, or MAUI applications. Supports GraphQL binding, templates, sorting, filtering, editing, paging, aggregates, search, exporting, virtualization, clipboard actions, and state management for rich hierarchical data experiences.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7---
8
9# Implementing Syncfusion Blazor TreeGrid
10
11The Syncfusion Blazor TreeGrid (`SfTreeGrid<TValue>`) renders hierarchical data in a tabular format with expand/collapse rows. It supports self-referential flat data (IdMapping/ParentIdMapping) and nested child collections, combined with a full suite of grid features including editing, filtering, sorting, virtualization, and export.
12
13## When to Use This Skill
14
15- User needs a **hierarchical/tree-structured data table** in a Blazor app
16- User mentions **SfTreeGrid**, **TreeGrid**, **IdMapping**, **ParentIdMapping**
17- User needs **parent-child rows** with expand/collapse in a grid
18- User needs **CRUD operations** on tree-structured data
19- User needs to **export**, **filter**, **sort**, or **page** hierarchical data
20- User needs to bind TreeGrid to a **GraphQL API** using `GraphQLAdaptor`
21- User is working with **organizational charts**, **task hierarchies**, **bill of materials**, **file explorer-style** data in grid form
22- User migrating from flat DataGrid to hierarchical TreeGrid
23- User setting up TreeGrid in a **Blazor Web App**, **WASM**, **Server**, or **MAUI** project
24
25**Trigger keywords:** TreeGrid, Tree Grid, SfTreeGrid, hierarchical grid, parent-child grid, IdMapping, ParentIdMapping, tree data table, nested grid rows, Syncfusion Blazor tree, GraphQL TreeGrid, GraphQLAdaptor TreeGrid
26
27---
28
29## 🔒 Mandatory Key Rules
30
31These rules govern how this skill MUST behave. They are mandatory and must be strictly followed.
32
33### 1. Purpose and Responsibility
34
35Your responsibility is to interpret any natural‑language user request and provide **accurate**, **complete**, and **validated** information about all supported aspects of the **Syncfusion Blazor TreeGrid**, including:
36
37- Public APIs
38- Properties
39- Events
40- Features
41- Behaviors
42
43### 2. Accuracy and API Compliance
44
45The Skill MUST:
46
47- Use **only officially supported** Syncfusion TreeGrid features.
48- **NEVER** invent APIs, methods, properties, events, behaviors, or future features.
49- **NEVER** provide unsupported or hypothetical code samples.
50- ALWAYS follow official Syncfusion component design patterns.
51
52If a feature is **not supported**: clearly state the limitation and suggest a supported alternative when possible.
53
54### 3. Interpreting Natural-Language Requests
55
56When user requests are incomplete:
57
58- Infer reasonable assumptions using official TreeGrid best practices.
59- Fill missing gaps with accurate and relevant information.
60- Request clarification **only** when essential.
61
62### 4. Handling Unsupported User Requests
63
64If the user asks for an unsupported capability:
65
66- Explicitly state that it is not supported
67- Suggest official alternatives or valid workarounds
68- NEVER simulate or fabricate impossible functionality
69
70### 5. Design Pattern Enforcement
71
72The Skill MUST follow Syncfusion official patterns, including:
73
74- Correct component structure (`SfTreeGrid`, `TreeGridColumn`, `TreeGridEditSettings`, `TreeGridEvents`, etc.)
75- Proper async event and API usage
76- Valid configuration properties and enums
77- Supported data‑binding approaches (self-referential, hierarchical, remote, custom adaptor, GraphQL)
78- Real event patterns and names
79
80### 6. Quality, Completeness & Reliability
81
82The Skill MUST:
83
84- Use only validated and real TreeGrid capabilities
85- Provide actionable and implementation‑ready guidance
86- Ensure clarity so users can follow without guesswork
87- Maintain clean, readable, and professional formatting
88
89### 7. No-Hallucination Safeguard
90
91The Skill MUST NOT:
92
93- Invent non‑existent APIs or behavior
94- Suggest unsupported modes, features, or configuration
95- Provide incorrect, misleading, or unverifiable code
96- Describe undocumented internal behavior
97
98If unsure: ask for clarification **OR** clearly state the limitation.
99
100### 8. Event Name Verification Requirement
101
102**CRITICAL:** Event names MUST be verified against `references/events.md` BEFORE providing code examples. All tree grid events MUST be defined inside the `<TreeGridEvents>` component
103
104**Common Mistakes to Avoid:**
105
106- ❌ `OnSortChange` — Does NOT exist. Use `Sorting`, `Sorted` instead
107- ❌ `OnFilterChange` — Does NOT exist. Use `Filtering`, `Filtered` instead
108
109
110**Rule:** ALWAYS cross-reference `references/events.md` for:
111
112- Exact event names (case-sensitive)
113- Event argument types (see **Rule 11** for namespace resolution)
114- Whether events are cancelable (✅ or ❌)
115- When they fire (before/after operation)
116
117### 9. Read Reference Files Before Writing Code
118
119Before generating **any** code, identify every feature in the request and **read the reference file for each one**. The snippets in this file are abbreviated — they omit critical rules and known pitfalls. Reference files are the authoritative source.
120
121> ⚠️ **Read ALL reference files that apply — not just the one most obvious from the query.**
122
123### 10. Namespace and Type Resolution Rules
124
125**Rule 1:** Always use full namespace qualification to avoid CS0104 "ambiguous reference" errors. Types exist in both `Syncfusion.Blazor.TreeGrid` and `Syncfusion.Blazor.Grids` namespaces.
126
127**Rule 2:** Always include `@using Syncfusion.Blazor.Grids;` in `_Imports.razor` or component to prevent CS0103 "missing reference" errors for:
128- Event argument types (`ActionEventArgs`, `RowDataBoundEventArgs`, `BeforeCopyPasteEventArgs`, etc.)
129- The `Action` enum (`Action.Sorting`, `Action.Save`, etc.)
130- Component classes (`TreeGridPageSettings`, `TreeGridFilterSettings`, `TreeGridSelectionSettings`, etc.)
131- Event handler support classes
132
133**Rule 3:** The following event arg types belong to `Syncfusion.Blazor.TreeGrid` — add `@using Syncfusion.Blazor.TreeGrid;` (NOT `Syncfusion.Blazor.Grids`):
134- `RowExpandingEventArgs<TValue>`, `RowExpandedEventArgs<TValue>`
135- `RowCollapsingEventArgs<TValue>`, `RowCollapsedEventArgs<TValue>`
136- `CheckBoxChangeEventArgs<TValue>`
137
138**Type Reference:**
139
140| Type | Namespace | Example |
141|---|---|---|
142| **FilterType** | TreeGrid | `Syncfusion.Blazor.TreeGrid.FilterType.Excel` |
143| **EditMode** | TreeGrid | `Syncfusion.Blazor.TreeGrid.EditMode.Row` |
144| **CopyHierarchyType** | TreeGrid | `Syncfusion.Blazor.TreeGrid.CopyHierarchyType.Both` |
145| **Action** | Grids | `Syncfusion.Blazor.Grids.Action.Save` |
146| **TextAlign** | Grids | `Syncfusion.Blazor.Grids.TextAlign.Right` |
147| **ColumnType** | Grids | `Syncfusion.Blazor.Grids.ColumnType.Date` |
148| **EditType** | Grids | `Syncfusion.Blazor.Grids.EditType.DatePickerEdit` |
149| **SelectionMode** | Grids | `Syncfusion.Blazor.Grids.SelectionMode.Row` |
150| **SelectionType** | Grids | `Syncfusion.Blazor.Grids.SelectionType.Multiple` |
151| **ClipMode** | Grids | `Syncfusion.Blazor.Grids.ClipMode.Ellipsis` |
152| **GridLine** | Grids | `Syncfusion.Blazor.Grids.GridLine.Horizontal` |
153| **AggregateType** | Grids | `Syncfusion.Blazor.Grids.AggregateType.Sum` |
154| **CellSelectionMode** | Grids | `Syncfusion.Blazor.Grids.CellSelectionMode.Box` |
155---
156
157## Component Overview
158
159```razor
160<SfTreeGrid DataSource="@TreeData"
161 IdMapping="TaskId"
162 ParentIdMapping="ParentId"
163 TreeColumnIndex="1"
164 AllowSorting="true"
165 AllowFiltering="true"
166 AllowPaging="true">
167 <TreeGridColumns>
168 <TreeGridColumn Field="TaskId" HeaderText="ID" Width="80" IsPrimaryKey="true" />
169 <TreeGridColumn Field="TaskName" HeaderText="Task Name" Width="200" />
170 <TreeGridColumn Field="Duration" HeaderText="Duration" Width="100" />
171 <TreeGridColumn Field="Progress" HeaderText="Progress" Width="100" />
172 </TreeGridColumns>
173</SfTreeGrid>
174```
175
176**Key concepts:**
177- `IdMapping` — property name that uniquely identifies each row
178- `ParentIdMapping` — property name pointing to the parent row's ID (null/0 = root)
179- `TreeColumnIndex` — column index that shows the expand/collapse icon (0-based)
180
181---
182
183## Navigation Guide
184
185### Setup & Getting Started
186- **Read:** [references/getting-started.md](references/getting-started.md)
187 - NuGet install, `_Imports.razor`, `Program.cs`, theme/script setup, basic grid, `IdMapping`/`ParentIdMapping`/`TreeColumnIndex`, expand-collapse all, `OnActionFailure`
188
189### Data Binding
190- **Read:** [references/data-binding.md](references/data-binding.md)
191 - Self-referential flat data, hierarchical nested children, remote URL/OData/Web API, `SfDataManager`, load on demand
192- **Read:** [references/custom-binding.md](references/custom-binding.md)
193 - `DataAdaptor` override, `Read`/`ReadAsync`, Insert/Update/Delete, paging & sorting support, self-referential only
194- **Read:** [references/graphql.md](references/graphql.md)
195 - Hot Chocolate server, `GraphQLAdaptor`, `GraphQLAdaptorOptions`, `DataManagerRequestInput`, CRUD mutations, cascading delete, CORS
196
197### Columns & Cells
198- **Read:** [references/columns.md](references/columns.md)
199 - `ColumnType`, `Format`, `TextAlign`, frozen, reorder, resize, chooser, stacked headers, column menu, foreign key
200- **Read:** [references/cell.md](references/cell.md)
201 - `QueryCellInfo`, `CustomAttributes`, `ClipMode`, `GridLines`, tooltips
202
203### Sorting, Filtering & Searching
204- **Read:** [references/sorting.md](references/sorting.md)
205 - `AllowSorting`, multi-sort, `SortComparer`, `SortColumnAsync`, `ClearSortingAsync`, hierarchy preserved
206- **Read:** [references/filtering.md](references/filtering.md)
207 - `AllowFiltering`, `FilterType` (FilterBar/Menu/Excel/CheckBox), hierarchy modes, operators, `FilterByColumnAsync`. ⚠️ See [filtering.md](references/filtering.md#filter-bar-default) for `FilterTemplate` rules
208- **Read:** [references/searching.md](references/searching.md)
209 - Toolbar Search, `SearchAsync`, `GridSearchSettings`, hierarchy modes, highlight/clear
210
211### Editing
212- **Read:** [references/editing.md](references/editing.md)
213 - Edit modes (Cell/Row/Dialog/Batch), edit types, command column, validation, template editing, EF Core. ⚠️ See [editing.md](references/editing.md#column-validation) for `ValidationRules`. Always add `@using Syncfusion.Blazor.Grids` when using `<TreeGridEvents>`
214
215### Rows & Selection
216- **Read:** [references/rows.md](references/rows.md)
217 - `RowDataBound`, row/detail template, drag-and-drop, row height, row spanning
218- **Read:** [references/selection.md](references/selection.md)
219 - Row/cell/both modes, checkbox column, toggle, drag select, programmatic selection, touch
220
221### Paging & Virtualization
222- **Read:** [references/paging.md](references/paging.md)
223 - `AllowPaging`, `TreeGridPageSettings`, `PageSize`, pager position/template, programmatic navigation
224- **Read:** [references/virtualization.md](references/virtualization.md)
225 - `EnableVirtualization`, `EnableColumnVirtualization`, vs. paging, limitations
226
227### Toolbar, Menus & Templates
228- **Read:** [references/toolbar.md](references/toolbar.md)
229 - Built-in & custom items, `EnableToolbarItemsAsync`, `OnToolbarClick`
230- **Read:** [references/context-menu.md](references/context-menu.md)
231 - `ContextMenuItems`, custom items, `ContextMenuItemClicked`, conditional show/hide
232- **Read:** [references/templates.md](references/templates.md)
233 - Column/header/row/detail/toolbar templates, loading indicator
234
235### Exporting & Scrolling
236- **Read:** [references/exporting.md](references/exporting.md)
237 - `ExportToExcelAsync`, `ExportToPdfAsync`, `PrintAsync`, custom data/headers, themes
238- **Read:** [references/scrolling.md](references/scrolling.md)
239 - Frozen rows/columns (`FrozenRows`, `IsFrozen`, `FreezeDirection`), `AllowFreezeLineMoving`, `EnableStickyHeader`, `ScrollIntoViewAsync`
240
241### Advanced Features
242- **Read:** [references/aggregates.md](references/aggregates.md)
243 - `TreeGridAggregateColumn` (`Field`+`Type` required), `AggregateType`, `FooterTemplate`, `ShowChildSummary`, custom LINQ, page-scope limitation
244- **Read:** [references/clipboard.md](references/clipboard.md)
245 - Copy (Ctrl+C/Ctrl+Shift+H), `CopyAsync`, paste (Box+Batch), `CopyHierarchyMode`, `BeforeCopyPaste`
246- **Read:** [references/autofill.md](references/autofill.md)
247 - `EnableAutoFill` + Cell/Box selection + Batch edit, limitations
248- **Read:** [references/adaptive-layout.md](references/adaptive-layout.md)
249 - `EnableAdaptiveUI`, full-screen dialogs, vertical row mode
250- **Read:** [references/state-management.md](references/state-management.md)
251 - `EnablePersistence`, persisted properties, manual state methods
252
253### Events
254- **Read:** [references/events.md](references/events.md)
255 - `TreeGridEvents<TValue>`, `OnActionBegin`/`OnActionComplete`, `RowDataBound`, `QueryCellInfo`, cancel actions
256
257---
258
259## Quick Start Example
260
261**1. Install NuGet:** `Syncfusion.Blazor.TreeGrid`
262
263**2. Register in `_Imports.razor`:**
264```razor
265@using Syncfusion.Blazor
266@using Syncfusion.Blazor.TreeGrid
267```
268
269**3. Add CSS in `wwwroot/index.html` or `App.razor`:**
270```html
271<link href="_content/Syncfusion.Blazor.Themes/material.css" rel="stylesheet" />
272```
273
274**4. Add to `Program.cs`:**
275```csharp
276builder.Services.AddSyncfusionBlazor();
277```
278
279**5. Minimal component:**
280```razor
281@using Syncfusion.Blazor.TreeGrid
282
283<SfTreeGrid DataSource="@TreeData" IdMapping="Id" ParentIdMapping="ParentId" TreeColumnIndex="1">
284 <TreeGridColumns>
285 <TreeGridColumn Field="Id" HeaderText="ID" Width="80" IsPrimaryKey="true" />
286 <TreeGridColumn Field="Name" HeaderText="Name" Width="200" />
287 <TreeGridColumn Field="Status" HeaderText="Status" Width="120" />
288 </TreeGridColumns>
289</SfTreeGrid>
290
291@code {
292 public class TaskItem
293 {
294 public int Id { get; set; }
295 public int? ParentId { get; set; }
296 public string Name { get; set; }
297 public string Status { get; set; }
298 }
299
300 private List<TaskItem> TreeData = new()
301 {
302 new TaskItem { Id = 1, ParentId = null, Name = "Project Alpha", Status = "In Progress" },
303 new TaskItem { Id = 2, ParentId = 1, Name = "Design Phase", Status = "Done" },
304 new TaskItem { Id = 3, ParentId = 1, Name = "Development", Status = "In Progress" },
305 new TaskItem { Id = 4, ParentId = 3, Name = "Backend API", Status = "Pending" },
306 };
307}
308```
309
310---
311
312## Common Patterns
313
314### Full-Featured TreeGrid (Sorting + Filtering + Paging + Editing)
315```razor
316<SfTreeGrid @ref="TreeGridRef"
317 DataSource="@TreeData"
318 IdMapping="Id"
319 ParentIdMapping="ParentId"
320 TreeColumnIndex="1"
321 AllowSorting="true"
322 AllowFiltering="true"
323 AllowPaging="true"
324 Toolbar="@(new List<string> { "Add", "Edit", "Delete", "Update", "Cancel" })">
325 <TreeGridEditSettings AllowAdding="true"
326 AllowEditing="true"
327 AllowDeleting="true"
328 Mode="Syncfusion.Blazor.TreeGrid.EditMode.Row" />
329 <TreeGridPageSettings PageSize="10" />
330 <TreeGridColumns>
331 <TreeGridColumn Field="Id" IsPrimaryKey="true" Visible="false" />
332 <TreeGridColumn Field="Name" HeaderText="Task" Width="220" />
333 <TreeGridColumn Field="Duration" HeaderText="Days" Width="100" />
334 <TreeGridColumn Field="Progress" HeaderText="%" Width="100" />
335 </TreeGridColumns>
336</SfTreeGrid>
337
338@code {
339 private SfTreeGrid<TaskItem> TreeGridRef;
340 // ... data and model
341}
342```
343
344### Excel & PDF Export
345```razor
346<SfTreeGrid @ref="TreeGridRef" AllowExcelExport="true" AllowPdfExport="true"
347 Toolbar="@(new List<string> { "ExcelExport", "PdfExport" })">
348 <TreeGridEvents TValue="TaskItem" OnToolbarClick="ToolbarClickHandler" />
349 ...
350</SfTreeGrid>
351
352@code {
353 private SfTreeGrid<TaskItem> TreeGridRef;
354
355 private async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
356 {
357 if (args.Item.Id.Contains("excelexport"))
358 await TreeGridRef.ExportToExcelAsync();
359 else if (args.Item.Id.Contains("pdfexport"))
360 await TreeGridRef.ExportToPdfAsync();
361 }
362}
363```