Syncfusion TypeScript TreeGrid
A comprehensive skill for implementing and customizing Syncfusion's Javascript TreeGrid component. TreeGrid visualizes self-referential hierarchical data in a tabular layout with expand/collapse functionality, enterprise features like virtual scrolling, and comprehensive export options.
## ⚠️ Security & Trust Boundary
- The TreeGrid skill does not perform any remote data access.
- All external API interaction is handled by a separate DataManager skill outside this skill’s trust boundary.
When to Use This Skill
Use this skill when you need to:
- Display hierarchical or tree-structured data (organizational charts, file systems, bill of materials)
- Configure columns with proper data binding and formatting
- Implement data editing (cell, row, dialog, batch, template modes)
- Add sorting, filtering, and searching capabilities
- Handle row and cell operations (selection, templates, spanning)
- Optimize performance with virtual scrolling or infinite scrolling
- Configure paging and scrolling strategies
- Export data to PDF, Excel, or CSV formats
- Implement state persistence and aggregation
- Customize appearance with themes and styling
- Support accessibility and internationalization (RTL, localization)
DO NOT use this skill for:
- Simple flat table display (use DataGrid instead)
- Tree view components (use TreeView control)
- File upload/download handling (separate concern)
Table of Contents
TreeGrid Overview
The TreeGrid is optimized for displaying self-referential hierarchical data with:
- Auto-expand/collapse functionality for collapsible rows
- Enterprise features: virtual scrolling, aggregates, state persistence
- Adaptive UI for mobile and small screens
- Comprehensive export: PDF, Excel, CSV formats
- Full accessibility: WCAG compliance, keyboard navigation, ARIA support
- Internationalization: RTL support, locale customization
Data Structure Rules
Rule 1: childMapping is MANDATORY for Hierarchical Data
Severity: 🔴 CRITICAL - Grid will not expand/collapse without this
Requirement:
import { TreeGrid } from '@syncfusion/ej2-treegrid';
// ✅ REQUIRED - childMapping matches data property name exactly
let treeGridObj: TreeGrid = new TreeGrid({
dataSource: hierarchicalData,
childMapping: 'subtasks', // Must match property in data
treeColumnIndex: 0,
columns: [
{ field: 'taskID', headerText: 'Task ID', width: 90 },
{ field: 'taskName', headerText: 'Task Name', width: 200 }
]
});
// ❌ WRONG - No childMapping = No expansion possible
let treeGridObj2: TreeGrid = new TreeGrid({
dataSource: hierarchicalData,
// Missing childMapping - Won't work!
columns: [...]
});
Data Format:
// ✅ CORRECT - childMapping matches 'subtasks' property
const hierarchicalData = [
{
taskID: 1,
taskName: 'Planning',
subtasks: [ // Must match childMapping value exactly
{ taskID: 2, taskName: 'Identify Site' },
{ taskID: 3, taskName: 'Perform Test' }
]
}
];
// Alternative: Flat structure with parent IDs
const flatData = [
{ taskID: 1, taskName: 'Planning', parentID: null, isParent: true },
{ taskID: 2, taskName: 'Identify Site', parentID: 1, isParent: false }
];
let treeGridObj3: TreeGrid = new TreeGrid({
dataSource: flatData,
idMapping: 'taskID',
parentIdMapping: 'parentID',
hasChildMapping: 'isParent'
});
Rule 2: Data Type Matching is MANDATORY
Severity: 🟠 IMPORTANT - Type mismatches cause rendering/sorting issues
Requirement:
// ✅ CORRECT - Type matches column definition
const data = [
{
taskID: 1, // number type
taskName: 'Planning', // string type
startDate: new Date(), // Date object for date columns
}
];
// Column definition must match data types
let treeGridObj: TreeGrid = new TreeGrid({
dataSource: data,
columns: [
{ field: 'taskID', headerText: 'ID', type: 'number', width: 90 },
{ field: 'taskName', headerText: 'Task', type: 'string', width: 200 },
{ field: 'startDate', headerText: 'Date', type: 'date', format: 'yMd', width: 120 }
]
});
// ❌ WRONG - Type mismatch
const badData = [
{
taskID: '1', // String instead of number
startDate: '02/03/2024' // String instead of Date object
}
];
API Reference
Properties & Methods
📄 Read: references/api-properties-methods.md
- Complete property reference (83 properties)
- Organized by category: Data & Configuration, Behavior & Display, Selection, Editing, Export, Advanced
- All methods (108 total)
- Method signatures and return types
- When to use? Setting up configuration, CRUD operations, DOM manipulation, row/cell management
Events & Modules
📄 Read: references/api-events-modules.md
- Complete event reference (66 events)
- Events organized by lifecycle: Lifecycle Events, Data, Edit, Selection, Expand/Collapse, Export, UI Interaction, Drag/Drop
- Feature modules (15 total)
- Module injection patterns and usage
- When to use? Responding to grid state changes, handling user interactions, optimizing feature loading
Feature Overview & Navigation Guide
The TreeGrid component provides comprehensive features for managing, displaying, and interacting with hierarchical data. Below is the complete navigation guide organized by feature area.
Getting Started
📄 Read: references/getting-started.md
- Installation and package setup
- TypeScript configuration
- Basic TreeGrid initialization
- Minimal data binding example
- First tree structure setup
Data Handling & Binding
📄 Read: references/data-handling.md
- Local data binding (hierarchical and self-referential structures)
- Hierarchical data with childMapping (nested arrays)
- Self-referential data with idMapping/parentIdMapping (flat data)
- Remote data binding with DataManager and adaptors
- Load on demand for lazy loading child records
- Offline mode for client-side processing
- Custom adaptors for extended functionality
- AJAX binding with Fetch API
- Immutable mode for performance optimization
- Error handling and CRUD operations via DataManager
Column Configuration & Features
📄 Read: references/columns.md
- Column basics (field binding, types, primary keys, per-column operation control)
- Column types (string, number, date, datetime, boolean) and formatting
- Header customization (text, templates, custom HTML)
- Column templates and value accessors (custom formatting, computed columns)
- Complex data binding with dot notation (nested objects, hierarchical data)
- Column resizing with min/max width constraints
- Column reordering via drag-drop or programmatic API
- Column visibility control (show/hide per column)
- Column menu with sort, filter, and autofit actions
- Column chooser for end-user visibility management
- Column spanning to merge cells horizontally
- Responsive columns that hide/show based on media queries
- Auto-fit columns to content width
- Frozen columns: Lock specific columns with isFrozen to keep visible while scrolling
- Freeze direction: Freeze columns at left or right side (freeze: 'Left'|'Right')
- Frozen with 4-zone layout: Combine frozenRows + frozenColumns for master-detail grids
Row Features & Templates
📄 Read: references/row-features.md
- Row selection modes (single, multiple)
- Checkbox selection
- Row detail/template expansion
- Row drag and drop
- Row indentation and spanning
- Row height configuration
- Frozen rows: Keep top N rows visible while scrolling vertically (frozenRows)
- Frozen rows + columns: Create 4-zone layout for master-detail grids
- Frozen rows with hierarchy: Expand/collapse works in frozen parent rows
- Frozen with detail templates: Combine frozen rows with master-detail patterns
Editing Operations
📄 Read: references/editing.md
- CRUD operations setup (Create, Read, Update, Delete)
- Edit modes (Cell, Row, Dialog, Batch) with use cases
- Edit types and components (text, number, dropdown, date, checkbox)
- Custom edit templates with create/write/read patterns
- Field validation (required, type, custom rules)
- Toolbar actions and delete confirmation dialogs
- Command column with built-in and custom buttons
- Default values and disabling column editing
- Server persistence with URL Adaptor and Remote Save Adaptor
- Server-side CRUD operation handlers (Insert, Update, Delete, Batch)
Sorting Features
📄 Read: references/sorting.md
- Sorting basics: Click column header to toggle ascending/descending
- Initial sort: Set default sort columns at load time via sortSettings
- Multi-column sort: Use CTRL+Click to sort by multiple columns
- Sort configuration: Disable sorting for specific columns, set default direction
- Sort methods: Programmatically sort or clear sorts (sortByColumn, clearSorting)
- Sort events: Respond to sort start/complete (actionBegin, actionComplete)
- Sort UI: Column header icons indicating sort direction
- Touch interaction: Multi-sort popup on touch devices
- Common patterns: Sort + Filter combinations, hierarchical sort behavior
Searching & Quick Find
📄 Read: references/searching.md
- Searching basics: Enable toolbar search box for text-based filtering
- Initial search: Set default search value and configuration at load time
- Search operators: Contains, startswith, endswith, equal, notequal matching
- Search configuration: Configure searchable columns and ignoreCase behavior
- Search external button: Trigger search programmatically from custom UI
- Search specific columns: Limit search scope to specific column fields only
- Search methods: Use search() method for programmatic searching
- Common patterns: Search + Sort, Search + Filter combinations
Filtering Options
📄 Read: references/filtering.md
- Filtering basics and configuration
- Filter hierarchy modes (Parent, Child, Both, None)
- Initial filters via filterSettings.columns
- Filter operators and expressions
- Filter bar with custom templates
- Filter menu with custom components
- Excel-like filter interface
- Diacritics and special character handling
- Programmatic filtering methods
Aggregation & Summaries
📄 Read: references/aggregation.md
- Aggregate types (sum, average, count, min, max, custom)
- Footer aggregates display
- Group-level aggregation
- Custom aggregate templates
Excel Export
📄 Read: references/excel-export.md
- Basic Excel export with hierarchy preservation
- Export options: persist collapsed state, include hidden columns, show/hide columns during export
- File name customization and custom data source
- Cell styling: conditional formatting (excelQueryCellInfo event), theme application
- Headers and footers with styling, hyperlinks, and alignment
- Server-side export: ASP.NET MVC configuration, serverExcelExport method
- CSV export (server-side): serverCsvExport method
- Custom aggregates export using excelAggregateQueryCellInfo event
PDF Export
📄 Read: references/pdf-export.md
- Basic PDF export with hierarchical layout
- Export options: include hidden columns, show/hide columns, page orientation, page size
- File name customization and font customization (standard + custom fonts)
- Cell styling: conditional formatting (pdfQueryCellInfo event), theme application
- Headers and footers: text, lines, page numbers, images with positioning
- Server-side export: ASP.NET MVC configuration, serverPdfExport method
- Header rotation using BeginCellLayout event (server-side only)
Performance Optimization
📄 Read: references/performance.md
- Performance best practices
- Change detection strategies
- Lazy loading data patterns
- Memory management
- Monitoring and optimization techniques
Styling & Appearance
📄 Read: references/styling-and-appearance.md
- Theme configuration: Material, Bootstrap, Fabric, HighContrast, Tailwind
- CSS customization: Override default styles with custom CSS classes
- Adaptive UI: enableAdaptiveUI for mobile-friendly interface with responsive dialogs
- CSS classes reference: Complete list of TreeGrid CSS classes (root, header, body, pager, summary)
- CSS class customization: Override specific sections with targeted CSS
Selection & Interaction
📄 Read: references/selection-and-interaction.md
- Cell and row selection modes
- Checkbox selection
- Mouse and keyboard interactions
- Context menu integration
- Clipboard operations (copy, cut, paste)
- Selection types: Single vs Multiple row/cell selection
- Selection modes: Row selection, Cell selection, Both modes
- Row selection: Initial, conditional, get selected rows programmatically
- Cell selection: Flow vs Box selection modes
- Checkbox selection with header select-all option
- Programmatic selection control (selectRow, selectRows, getSelectedRecords)
- Toggle selection: Click selected row again to deselect
- Touch interactions: Multi-select popup on touch devices
- Selection events and event handlers (rowSelected, cellSelected)
- Bulk actions on selected rows (delete, archive, etc.)
Context Menu
📄 Read: references/context-menu.md
- Context menu basics: Enable with ContextMenu module injection
- Default menu items: AutoFit, Edit, Delete, Export, Sort, Page, Indent, Outdent
- Custom menu items: Define custom items with text, target, and id properties
- Custom item actions: Handle in contextMenuClick event handler
- Dynamic enable/disable: Use contextMenuOpen event to toggle item availability
- Target-specific menus: Show menus for header, row, or content areas using target property
- Common scenarios: Expand/Collapse rows, Edit/Delete records, Export actions
Paging Configuration
📄 Read: references/paging.md
- Paging setup with Page module injection and allowPaging property
- Page size modes: All (total count) vs Root (parent count only)
- Page size dropdown: Let users change rows per page dynamically
- Custom pager templates with page navigation controls
- Pager positioning: Move pager from bottom to top
- Programmatic page navigation (goToPage, goToNextPage, goToPreviousPage)
- Page change events (actionComplete with requestType: 'paging')
- Responsive page size based on screen width
- Tracking page changes for data loading or UI updates
Scrolling & Performance
📄 Read: references/scrolling.md
- Basic scrolling: Fixed height/width containers with auto scrollbars
- Responsive scrolling: 100% height/width in parent containers
- Sticky headers: Keep column headers visible while scrolling with enableStickyHeader
- Scroll to row: Jump to specific row or scroll selected row into view
- Row virtualization: Render only visible rows for 10,000+ row datasets (enableVirtualization)
- Column virtualization: Render only visible columns for 100+ column grids (enableColumnVirtualization)
- Infinite scrolling: Load buffer pages as user scrolls down (enableInfiniteScrolling)
- Infinite scroll cache mode: Cache loaded pages to avoid re-fetching
- Performance comparison: When to use paging vs virtual vs infinite scrolling
- Virtual vs Infinite: Virtual for client-side data, Infinite for server-side data
- Limitations: Virtual/Infinite don't support batch edit, detail templates, row templates
Advanced Features & Operations
📄 Read: references/advanced-features.md
- Print: Toolbar print button, print modes (All/CurrentPage), show/hide columns while printing
- Toolbar: Built-in items, custom toolbar buttons, enable/disable toolbar items
- Clipboard: Copy/paste shortcuts, hierarchy modes, AutoFill in batch edit
- State Persistence: Enable persistence, get/set localStorage, persisted properties
Loading Animation
📄 Read: references/loading-animation.md
- Spinner and Shimmer loading indicator types
- Automatic display during data operations
- Remote data source loading
Global Locale & Accessibility
📄 Read: references/global-local-accessibility.md
- Localization: L10n.load() for culture-specific translations, locale property setup
- Localization of dependent components: DatePicker, Form Validator, Grid
- Internationalization: loadCldr, setCulture, setCurrencyCode for number/date formatting
- Right-to-Left (RTL): enableRtl property for Arabic, Farsi, Urdu languages
- Accessibility compliance: WCAG 2.2, Section 508, screen reader support standards
- WAI-ARIA attributes: role=treegrid, aria-selected, aria-expanded, aria-sort, aria-busy, aria-label
- Keyboard navigation: Complete keyboard shortcuts and accessibility-checker validation
Testing & Test Helpers
📄 Read: references/testing-and-helpers.md
- Helper API reference: 20+ helper methods for DOM element access and property manipulation
- Setting up Cypress: Project initialization, Syncfusion package installation, Cypress configuration
- TreeGridHelper initialization: Import and instantiate helper with element ID
- Using setModel/getModel: Set and retrieve TreeGrid properties dynamically
- Using invoke function: Call TreeGrid methods programmatically (collapseAll, expandAll, print, export)
- Testing element access: Get header, footer, pager, dialog, filter, and content elements
- Writing test cases: Complete examples for property access, method invocation, and UI interaction
- Running Cypress: Interactive mode, headless mode, browser selection, spec file targeting
- Best practices: Use helpers instead of CSS selectors, meaningful delays, data setup, cleanup
Quick Start Example
Here's a minimal TypeScript TreeGrid setup with vanilla Inject pattern:
import { TreeGrid, Page, Edit } from '@syncfusion/ej2-treegrid';
// Data interface for type safety
interface TreeGridData {
taskID: number;
taskName: string;
startDate: Date;
endDate: Date;
duration: number;
progress: number;
subtasks?: TreeGridData[];
}
// Sample hierarchical data
const data: TreeGridData[] = [
{
taskID: 1,
taskName: 'Planning',
startDate: new Date('02/03/2017'),
endDate: new Date('02/07/2017'),
duration: 5,
progress: 100,
subtasks: [
{
taskID: 2,
taskName: 'Identify Site location',
startDate: new Date('02/03/2017'),
endDate: new Date('02/04/2017'),
duration: 2,
progress: 100
},
{
taskID: 3,
taskName: 'Perform soil test',
startDate: new Date('02/04/2017'),
endDate: new Date('02/05/2017'),
duration: 1,
progress: 100
}
]
}
];
// Inject required modules
TreeGrid.Inject(Page, Edit);
// Initialize TreeGrid
let treeGridObj: TreeGrid = new TreeGrid({
dataSource: data,
childMapping: 'subtasks',
allowPaging: true,
pageSettings: { pageSize: 10 },
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Row' },
treeColumnIndex: 1,
columns: [
{ field: 'taskID', headerText: 'Task ID', isPrimaryKey: true, width: 90, textAlign: 'Right' },
{ field: 'taskName', headerText: 'Task Name', width: 180, textAlign: 'Left' },
{ field: 'startDate', headerText: 'Start Date', width: 90, textAlign: 'Right', type: 'date', format: 'yMd' },
{ field: 'duration', headerText: 'Duration', width: 80, textAlign: 'Right' },
{ field: 'progress', headerText: 'Progress (%)', width: 80, textAlign: 'Right' }
]
});
treeGridObj.appendTo('#TreeGrid');
1---2name: syncfusion-javascript-treegrid3description: Implements Syncfusion Javascript TreeGrid for hierarchical data with sorting, filtering, editing, exporting, paging, virtual scrolling, and advanced features. Supports configuration, CRUD, aggregates, templates, state persistence, and performance optimization in Javascript applications.4---56# Syncfusion TypeScript TreeGrid78A comprehensive skill for implementing and customizing Syncfusion's Javascript TreeGrid component. TreeGrid visualizes self-referential hierarchical data in a tabular layout with expand/collapse functionality, enterprise features like virtual scrolling, and comprehensive export options.910 ## ⚠️ Security & Trust Boundary11 12- The TreeGrid skill does not perform any remote data access.13- All external API interaction is handled by a separate DataManager skill outside this skill’s trust boundary.1415## When to Use This Skill1617Use this skill when you need to:18 - Display hierarchical or tree-structured data (organizational charts, file systems, bill of materials)19 - Configure columns with proper data binding and formatting20 - Implement data editing (cell, row, dialog, batch, template modes)21 - Add sorting, filtering, and searching capabilities22 - Handle row and cell operations (selection, templates, spanning)23 - Optimize performance with virtual scrolling or infinite scrolling24 - Configure paging and scrolling strategies25 - Export data to PDF, Excel, or CSV formats26 - Implement state persistence and aggregation27 - Customize appearance with themes and styling28 - Support accessibility and internationalization (RTL, localization)2930**DO NOT use this skill for:**31- Simple flat table display (use DataGrid instead)32- Tree view components (use TreeView control)33- File upload/download handling (separate concern)3435## Table of Contents36 - [TreeGrid Overview](#treegrid-overview)37 - [Data Structure Rules](#data-structure-rules)38 - [API Reference](#api-reference)39 - [Feature Overview & Navigation Guide](#feature-overview--navigation-guide)40 - [Quick Start Example](#quick-start-example)4142## TreeGrid Overview4344The TreeGrid is optimized for displaying self-referential hierarchical data with:45 - **Auto-expand/collapse** functionality for collapsible rows46 - **Enterprise features**: virtual scrolling, aggregates, state persistence47 - **Adaptive UI** for mobile and small screens48 - **Comprehensive export**: PDF, Excel, CSV formats49 - **Full accessibility**: WCAG compliance, keyboard navigation, ARIA support50 - **Internationalization**: RTL support, locale customization5152## Data Structure Rules5354### Rule 1: childMapping is MANDATORY for Hierarchical Data55**Severity**: 🔴 CRITICAL - Grid will not expand/collapse without this5657**Requirement**:58```typescript59import { TreeGrid } from '@syncfusion/ej2-treegrid';6061// ✅ REQUIRED - childMapping matches data property name exactly62let treeGridObj: TreeGrid = new TreeGrid({63 dataSource: hierarchicalData,64 childMapping: 'subtasks', // Must match property in data65 treeColumnIndex: 0,66 columns: [67 { field: 'taskID', headerText: 'Task ID', width: 90 },68 { field: 'taskName', headerText: 'Task Name', width: 200 }69 ]70});7172// ❌ WRONG - No childMapping = No expansion possible73let treeGridObj2: TreeGrid = new TreeGrid({74 dataSource: hierarchicalData,75 // Missing childMapping - Won't work!76 columns: [...]77});78```7980**Data Format**:81```typescript82// ✅ CORRECT - childMapping matches 'subtasks' property83const hierarchicalData = [84 {85 taskID: 1,86 taskName: 'Planning',87 subtasks: [ // Must match childMapping value exactly88 { taskID: 2, taskName: 'Identify Site' },89 { taskID: 3, taskName: 'Perform Test' }90 ]91 }92];9394// Alternative: Flat structure with parent IDs95const flatData = [96 { taskID: 1, taskName: 'Planning', parentID: null, isParent: true },97 { taskID: 2, taskName: 'Identify Site', parentID: 1, isParent: false }98];99100let treeGridObj3: TreeGrid = new TreeGrid({101 dataSource: flatData,102 idMapping: 'taskID',103 parentIdMapping: 'parentID',104 hasChildMapping: 'isParent'105});106```107108### Rule 2: Data Type Matching is MANDATORY109**Severity**: 🟠 IMPORTANT - Type mismatches cause rendering/sorting issues110111**Requirement**:112```typescript113// ✅ CORRECT - Type matches column definition114const data = [115 {116 taskID: 1, // number type117 taskName: 'Planning', // string type118 startDate: new Date(), // Date object for date columns119 }120];121122// Column definition must match data types123let treeGridObj: TreeGrid = new TreeGrid({124 dataSource: data,125 columns: [126 { field: 'taskID', headerText: 'ID', type: 'number', width: 90 },127 { field: 'taskName', headerText: 'Task', type: 'string', width: 200 },128 { field: 'startDate', headerText: 'Date', type: 'date', format: 'yMd', width: 120 }129 ]130});131132// ❌ WRONG - Type mismatch133const badData = [134 {135 taskID: '1', // String instead of number136 startDate: '02/03/2024' // String instead of Date object137 }138];139```140141---142143## API Reference144145### Properties & Methods146📄 **Read:** [references/api-properties-methods.md](references/api-properties-methods.md)147- Complete property reference (83 properties)148- Organized by category: Data & Configuration, Behavior & Display, Selection, Editing, Export, Advanced149- All methods (108 total)150- Method signatures and return types151- When to use? Setting up configuration, CRUD operations, DOM manipulation, row/cell management152153### Events & Modules154📄 **Read:** [references/api-events-modules.md](references/api-events-modules.md)155- Complete event reference (66 events)156- Events organized by lifecycle: Lifecycle Events, Data, Edit, Selection, Expand/Collapse, Export, UI Interaction, Drag/Drop157- Feature modules (15 total)158- Module injection patterns and usage159- When to use? Responding to grid state changes, handling user interactions, optimizing feature loading160161---162163## Feature Overview & Navigation Guide164165The TreeGrid component provides comprehensive features for managing, displaying, and interacting with hierarchical data. Below is the complete navigation guide organized by feature area.166167### Getting Started168📄 **Read:** [references/getting-started.md](references/getting-started.md)169- Installation and package setup170- TypeScript configuration171- Basic TreeGrid initialization172- Minimal data binding example173- First tree structure setup174175### Data Handling & Binding176📄 **Read:** [references/data-handling.md](references/data-handling.md)177- Local data binding (hierarchical and self-referential structures)178- Hierarchical data with childMapping (nested arrays)179- Self-referential data with idMapping/parentIdMapping (flat data)180- Remote data binding with DataManager and adaptors181- Load on demand for lazy loading child records182- Offline mode for client-side processing183- Custom adaptors for extended functionality184- AJAX binding with Fetch API185- Immutable mode for performance optimization186- Error handling and CRUD operations via DataManager187188### Column Configuration & Features189📄 **Read:** [references/columns.md](references/columns.md)190- Column basics (field binding, types, primary keys, per-column operation control)191- Column types (string, number, date, datetime, boolean) and formatting192- Header customization (text, templates, custom HTML)193- Column templates and value accessors (custom formatting, computed columns)194- Complex data binding with dot notation (nested objects, hierarchical data)195- Column resizing with min/max width constraints196- Column reordering via drag-drop or programmatic API197- Column visibility control (show/hide per column)198- Column menu with sort, filter, and autofit actions199- Column chooser for end-user visibility management200- Column spanning to merge cells horizontally201- Responsive columns that hide/show based on media queries202- Auto-fit columns to content width203- Frozen columns: Lock specific columns with isFrozen to keep visible while scrolling204- Freeze direction: Freeze columns at left or right side (freeze: 'Left'|'Right')205- Frozen with 4-zone layout: Combine frozenRows + frozenColumns for master-detail grids206207### Row Features & Templates208📄 **Read:** [references/row-features.md](references/row-features.md)209- Row selection modes (single, multiple)210- Checkbox selection211- Row detail/template expansion212- Row drag and drop213- Row indentation and spanning214- Row height configuration215- Frozen rows: Keep top N rows visible while scrolling vertically (frozenRows)216- Frozen rows + columns: Create 4-zone layout for master-detail grids217- Frozen rows with hierarchy: Expand/collapse works in frozen parent rows218- Frozen with detail templates: Combine frozen rows with master-detail patterns219220### Editing Operations221📄 **Read:** [references/editing.md](references/editing.md)222- CRUD operations setup (Create, Read, Update, Delete)223- Edit modes (Cell, Row, Dialog, Batch) with use cases224- Edit types and components (text, number, dropdown, date, checkbox)225- Custom edit templates with create/write/read patterns226- Field validation (required, type, custom rules)227- Toolbar actions and delete confirmation dialogs228- Command column with built-in and custom buttons229- Default values and disabling column editing230- Server persistence with URL Adaptor and Remote Save Adaptor231- Server-side CRUD operation handlers (Insert, Update, Delete, Batch)232233### Sorting Features234📄 **Read:** [references/sorting.md](references/sorting.md)235- Sorting basics: Click column header to toggle ascending/descending236- Initial sort: Set default sort columns at load time via sortSettings237- Multi-column sort: Use CTRL+Click to sort by multiple columns238- Sort configuration: Disable sorting for specific columns, set default direction239- Sort methods: Programmatically sort or clear sorts (sortByColumn, clearSorting)240- Sort events: Respond to sort start/complete (actionBegin, actionComplete)241- Sort UI: Column header icons indicating sort direction242- Touch interaction: Multi-sort popup on touch devices243- Common patterns: Sort + Filter combinations, hierarchical sort behavior244245### Searching & Quick Find246📄 **Read:** [references/searching.md](references/searching.md)247- Searching basics: Enable toolbar search box for text-based filtering248- Initial search: Set default search value and configuration at load time249- Search operators: Contains, startswith, endswith, equal, notequal matching250- Search configuration: Configure searchable columns and ignoreCase behavior251- Search external button: Trigger search programmatically from custom UI252- Search specific columns: Limit search scope to specific column fields only253- Search methods: Use search() method for programmatic searching254- Common patterns: Search + Sort, Search + Filter combinations255256### Filtering Options257📄 **Read:** [references/filtering.md](references/filtering.md)258- Filtering basics and configuration259- Filter hierarchy modes (Parent, Child, Both, None)260- Initial filters via filterSettings.columns261- Filter operators and expressions262- Filter bar with custom templates263- Filter menu with custom components264- Excel-like filter interface265- Diacritics and special character handling266- Programmatic filtering methods267268### Aggregation & Summaries269📄 **Read:** [references/aggregation.md](references/aggregation.md)270- Aggregate types (sum, average, count, min, max, custom)271- Footer aggregates display272- Group-level aggregation273- Custom aggregate templates274275### Excel Export276📄 **Read:** [references/excel-export.md](references/excel-export.md)277- Basic Excel export with hierarchy preservation278- Export options: persist collapsed state, include hidden columns, show/hide columns during export279- File name customization and custom data source280- Cell styling: conditional formatting (excelQueryCellInfo event), theme application281- Headers and footers with styling, hyperlinks, and alignment282- Server-side export: ASP.NET MVC configuration, serverExcelExport method283- CSV export (server-side): serverCsvExport method284- Custom aggregates export using excelAggregateQueryCellInfo event285286### PDF Export287📄 **Read:** [references/pdf-export.md](references/pdf-export.md)288- Basic PDF export with hierarchical layout289- Export options: include hidden columns, show/hide columns, page orientation, page size290- File name customization and font customization (standard + custom fonts)291- Cell styling: conditional formatting (pdfQueryCellInfo event), theme application292- Headers and footers: text, lines, page numbers, images with positioning293- Server-side export: ASP.NET MVC configuration, serverPdfExport method294- Header rotation using BeginCellLayout event (server-side only)295296### Performance Optimization297📄 **Read:** [references/performance.md](references/performance.md)298- Performance best practices299- Change detection strategies300- Lazy loading data patterns301- Memory management302- Monitoring and optimization techniques303304### Styling & Appearance305📄 **Read:** [references/styling-and-appearance.md](references/styling-and-appearance.md)306- Theme configuration: Material, Bootstrap, Fabric, HighContrast, Tailwind307- CSS customization: Override default styles with custom CSS classes308- Adaptive UI: enableAdaptiveUI for mobile-friendly interface with responsive dialogs309- CSS classes reference: Complete list of TreeGrid CSS classes (root, header, body, pager, summary)310- CSS class customization: Override specific sections with targeted CSS311312### Selection & Interaction313📄 **Read:** [references/selection-and-interaction.md](references/selection-and-interaction.md)314- Cell and row selection modes315- Checkbox selection316- Mouse and keyboard interactions317- Context menu integration318- Clipboard operations (copy, cut, paste)319- Selection types: Single vs Multiple row/cell selection320- Selection modes: Row selection, Cell selection, Both modes321- Row selection: Initial, conditional, get selected rows programmatically322- Cell selection: Flow vs Box selection modes323- Checkbox selection with header select-all option324- Programmatic selection control (selectRow, selectRows, getSelectedRecords)325- Toggle selection: Click selected row again to deselect326- Touch interactions: Multi-select popup on touch devices327- Selection events and event handlers (rowSelected, cellSelected)328- Bulk actions on selected rows (delete, archive, etc.)329330### Context Menu331📄 **Read:** [references/context-menu.md](references/context-menu.md)332- Context menu basics: Enable with ContextMenu module injection333- Default menu items: AutoFit, Edit, Delete, Export, Sort, Page, Indent, Outdent334- Custom menu items: Define custom items with text, target, and id properties335- Custom item actions: Handle in contextMenuClick event handler336- Dynamic enable/disable: Use contextMenuOpen event to toggle item availability337- Target-specific menus: Show menus for header, row, or content areas using target property338- Common scenarios: Expand/Collapse rows, Edit/Delete records, Export actions339340### Paging Configuration341📄 **Read:** [references/paging.md](references/paging.md)342- Paging setup with Page module injection and allowPaging property343- Page size modes: All (total count) vs Root (parent count only)344- Page size dropdown: Let users change rows per page dynamically345- Custom pager templates with page navigation controls346- Pager positioning: Move pager from bottom to top347- Programmatic page navigation (goToPage, goToNextPage, goToPreviousPage)348- Page change events (actionComplete with requestType: 'paging')349- Responsive page size based on screen width350- Tracking page changes for data loading or UI updates351352### Scrolling & Performance353📄 **Read:** [references/scrolling.md](references/scrolling.md)354- Basic scrolling: Fixed height/width containers with auto scrollbars355- Responsive scrolling: 100% height/width in parent containers356- Sticky headers: Keep column headers visible while scrolling with enableStickyHeader357- Scroll to row: Jump to specific row or scroll selected row into view358- Row virtualization: Render only visible rows for 10,000+ row datasets (enableVirtualization)359- Column virtualization: Render only visible columns for 100+ column grids (enableColumnVirtualization)360- Infinite scrolling: Load buffer pages as user scrolls down (enableInfiniteScrolling)361- Infinite scroll cache mode: Cache loaded pages to avoid re-fetching362- Performance comparison: When to use paging vs virtual vs infinite scrolling363- Virtual vs Infinite: Virtual for client-side data, Infinite for server-side data364- Limitations: Virtual/Infinite don't support batch edit, detail templates, row templates365366### Advanced Features & Operations367368📄 **Read:** [references/advanced-features.md](references/advanced-features.md)369- Print: Toolbar print button, print modes (All/CurrentPage), show/hide columns while printing370- Toolbar: Built-in items, custom toolbar buttons, enable/disable toolbar items371- Clipboard: Copy/paste shortcuts, hierarchy modes, AutoFill in batch edit372- State Persistence: Enable persistence, get/set localStorage, persisted properties373374### Loading Animation375376📄 **Read:** [references/loading-animation.md](references/loading-animation.md)377- Spinner and Shimmer loading indicator types378- Automatic display during data operations379- Remote data source loading380381### Global Locale & Accessibility382383📄 **Read:** [references/global-local-accessibility.md](references/global-local-accessibility.md)384- Localization: L10n.load() for culture-specific translations, locale property setup385- Localization of dependent components: DatePicker, Form Validator, Grid386- Internationalization: loadCldr, setCulture, setCurrencyCode for number/date formatting387- Right-to-Left (RTL): enableRtl property for Arabic, Farsi, Urdu languages388- Accessibility compliance: WCAG 2.2, Section 508, screen reader support standards389- WAI-ARIA attributes: role=treegrid, aria-selected, aria-expanded, aria-sort, aria-busy, aria-label390- Keyboard navigation: Complete keyboard shortcuts and accessibility-checker validation391392### Testing & Test Helpers393394📄 **Read:** [references/testing-and-helpers.md](references/testing-and-helpers.md)395- Helper API reference: 20+ helper methods for DOM element access and property manipulation396- Setting up Cypress: Project initialization, Syncfusion package installation, Cypress configuration397- TreeGridHelper initialization: Import and instantiate helper with element ID398- Using setModel/getModel: Set and retrieve TreeGrid properties dynamically399- Using invoke function: Call TreeGrid methods programmatically (collapseAll, expandAll, print, export)400- Testing element access: Get header, footer, pager, dialog, filter, and content elements401- Writing test cases: Complete examples for property access, method invocation, and UI interaction402- Running Cypress: Interactive mode, headless mode, browser selection, spec file targeting403- Best practices: Use helpers instead of CSS selectors, meaningful delays, data setup, cleanup404405---406407## Quick Start Example408409Here's a minimal TypeScript TreeGrid setup with vanilla Inject pattern:410411```typescript412import { TreeGrid, Page, Edit } from '@syncfusion/ej2-treegrid';413414// Data interface for type safety415interface TreeGridData {416 taskID: number;417 taskName: string;418 startDate: Date;419 endDate: Date;420 duration: number;421 progress: number;422 subtasks?: TreeGridData[];423}424425// Sample hierarchical data426const data: TreeGridData[] = [427 {428 taskID: 1,429 taskName: 'Planning',430 startDate: new Date('02/03/2017'),431 endDate: new Date('02/07/2017'),432 duration: 5,433 progress: 100,434 subtasks: [435 {436 taskID: 2,437 taskName: 'Identify Site location',438 startDate: new Date('02/03/2017'),439 endDate: new Date('02/04/2017'),440 duration: 2,441 progress: 100442 },443 {444 taskID: 3,445 taskName: 'Perform soil test',446 startDate: new Date('02/04/2017'),447 endDate: new Date('02/05/2017'),448 duration: 1,449 progress: 100450 }451 ]452 }453];454455// Inject required modules456TreeGrid.Inject(Page, Edit);457458// Initialize TreeGrid459let treeGridObj: TreeGrid = new TreeGrid({460 dataSource: data,461 childMapping: 'subtasks',462 allowPaging: true,463 pageSettings: { pageSize: 10 },464 editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Row' },465 treeColumnIndex: 1,466 columns: [467 { field: 'taskID', headerText: 'Task ID', isPrimaryKey: true, width: 90, textAlign: 'Right' },468 { field: 'taskName', headerText: 'Task Name', width: 180, textAlign: 'Left' },469 { field: 'startDate', headerText: 'Start Date', width: 90, textAlign: 'Right', type: 'date', format: 'yMd' },470 { field: 'duration', headerText: 'Duration', width: 80, textAlign: 'Right' },471 { field: 'progress', headerText: 'Progress (%)', width: 80, textAlign: 'Right' }472 ]473});474475treeGridObj.appendTo('#TreeGrid');476```477