syncfusion-maui-treeview

$npx mdskill add syncfusion/maui-ui-components-skills/syncfusion-maui-treeview

Implements and customizes Syncfusion .NET MAUI TreeView for hierarchical data.

  • Displays hierarchical data like organizational charts or file systems.
  • Depends on Syncfusion .NET MAUI TreeView (SfTreeView) NuGet package.
  • Uses data binding to ItemsSource or manual node creation for tree structure.
  • Provides expand/collapse, selection, drag-drop, and custom templating.

SKILL.md

.github/skills/syncfusion-maui-treeviewView on GitHub ↗
---
name: syncfusion-maui-treeview
description: Implements and customize Syncfusion .NET MAUI TreeView (SfTreeView) for displaying hierarchical data structures. Use when working with TreeView, hierarchical data display, tree structures, organizational charts, nested data, expand/collapse nodes, file explorer UI, folder structures, parent-child relationships, or multi-level data visualization in .NET MAUI applications.
metadata:
  author: "Syncfusion Inc"
  version: "34.1.29"
---

# Implementing Syncfusion .NET MAUI TreeView

The Syncfusion .NET MAUI TreeView (SfTreeView) is a powerful data-oriented control for displaying hierarchical data structures such as organizational charts, file systems, nested connections, and multi-level data. It provides intuitive expand/collapse functionality, multiple selection modes, drag-and-drop support, and extensive customization options.

## When to Use This Skill

Use this skill when implementing:

- **Hierarchical Data Display**: Organizational structures, file explorers, category trees, nested menus
- **Interactive Tree Navigation**: Expandable/collapsible nodes, multi-level browsing
- **Data Binding Scenarios**: Bound mode with ItemsSource or unbound mode with manual nodes
- **Selection Requirements**: Single, multiple, or extended selection in tree structures
- **Custom Tree UI**: Templated nodes, custom expanders, styled tree items
- **Advanced Tree Features**: Drag-drop reordering, filtering, sorting, load on demand
- **MVVM Applications**: TreeView with commands, data binding, and ViewModel patterns

## Component Overview

**Key Capabilities:**
- Enhanced performance with optimized view-reusing strategy
- Bound and unbound data modes
- Multiple selection modes with keyboard navigation
- Item and expander templating
- Expand/collapse with animations
- Drag-and-drop node reordering
- Filtering and sorting support
- Load on demand for large datasets
- MVVM pattern support
- RTL (right-to-left) support
- Customizable appearance and styling

## Documentation and Navigation Guide

### Getting Started

📄 **Read:** [references/getting-started.md](references/getting-started.md)

**When to read:** Setting up TreeView for the first time, initial configuration, basic implementation

**Covers:**
- Installing Syncfusion.Maui.TreeView NuGet package
- Registering Syncfusion handler in MauiProgram.cs
- Creating a basic TreeView control
- First working example
- Running and testing the application

---

### Data Binding and Population

📄 **Read:** [references/data-binding.md](references/data-binding.md)

**When to read:** Populating TreeView with data, choosing between bound/unbound modes, hierarchical data structures

**Covers:**
- Bound vs unbound modes comparison
- Creating nodes without data source (unbound mode with TreeViewNode)
- Data binding with ItemsSource (bound mode)
- Defining hierarchical data models
- Using HierarchyPropertyDescriptors for complex hierarchies
- ChildPropertyName configuration
- Self-relational data structures
- ObservableCollection integration

---

### Selection

📄 **Read:** [references/selection.md](references/selection.md)

**When to read:** Implementing node selection, handling selection events, customizing selection appearance

**Covers:**
- Selection modes: Single, SingleDeselect, Multiple, Extended, None
- SelectedItem, CurrentItem, and SelectedItems properties
- SelectionChanging and SelectionChanged events
- SelectionBackground and SelectionForeground customization
- Keyboard navigation (WinUI, MacCatalyst)
- Programmatic selection
- Selection validation and cancellation

---

### Node Expansion and Collapse

📄 **Read:** [references/expand-collapse.md](references/expand-collapse.md)

**When to read:** Configuring expand/collapse behavior, handling expansion events, initial node states

**Covers:**
- AutoExpandMode options (None, AllNodes, RootNodes, specific levels)
- ExpandActionTarget (Expander, Node)
- Programmatic expand/collapse methods
- NodeExpanding and NodeCollapsing events
- IsExpanded property for individual nodes
- Expand/collapse animations
- Event cancellation and validation

---

### Templating and Customization

📄 **Read:** [references/templating.md](references/templating.md)

**When to read:** Customizing node appearance, creating custom expanders, designing tree item UI

**Covers:**
- ItemTemplate for node content customization
- ExpanderTemplate for custom expand/collapse icons
- ItemTemplateContextType (Node vs Data binding context)
- DataTemplate creation and binding
- Mixing images, text, and custom controls
- Template selectors for conditional templates
- Advanced templating patterns

---

### Drag and Drop

📄 **Read:** [references/drag-and-drop.md](references/drag-and-drop.md)

**When to read:** Enabling node reordering, implementing drag-drop functionality, customizing drag behavior

**Covers:**
- Enabling AllowDragging property
- DragStarting, DragOver, and Drop events
- Reordering nodes within the tree
- Drag restrictions and validation
- Visual feedback during drag operations
- Custom drag templates
- Handling drag between different levels

---

### Filtering

📄 **Read:** [references/filtering.md](references/filtering.md)

**When to read:** Filtering tree nodes, implementing search functionality, showing/hiding nodes based on criteria

**Covers:**
- FilterLevel property (Root, All, Extended)
- Filter predicates and expressions
- Filtering hierarchical data
- Clearing and updating filters
- Dynamic filtering with ObservableCollection
- Performance considerations

---

### Sorting

📄 **Read:** [references/sorting.md](references/sorting.md)

**When to read:** Sorting tree nodes, custom sort logic, multi-level sorting

**Covers:**
- SortComparer configuration
- Sorting hierarchical data at each level
- Custom IComparer implementations
- Ascending/descending order
- Sorting with data binding
- Performance optimization for large trees

---

### Styling and Appearance

📄 **Read:** [references/styling-appearance.md](references/styling-appearance.md)

**When to read:** Customizing visual appearance, adjusting spacing and indentation, applying themes

**Covers:**
- Item height customization (ItemHeight property)
- Indentation settings for nested levels
- Liquid glass effect styling
- RTL (right-to-left) support
- Background and foreground colors
- Border and padding customization
- Theme integration

---

### MVVM Support

📄 **Read:** [references/mvvm-support.md](references/mvvm-support.md)

**When to read:** Implementing TreeView with MVVM pattern, using commands and data binding

**Covers:**
- ViewModel setup for TreeView
- INotifyPropertyChanged implementation
- Command binding for node actions
- Data-bound ItemsSource
- Selection binding in MVVM
- Event-to-command patterns
- Best practices for MVVM architecture

---

### Checkbox Support

📄 **Read:** [references/checkbox-support.md](references/checkbox-support.md)

**When to read:** Adding checkboxes to nodes, handling checked/unchecked states, recursive checkbox modes

**Covers:**
- Checkbox in bound mode with CheckedItems
- Checkbox in unbound mode with IsChecked property
- CheckBoxMode property (Recursive, Cascade, None)
- Working with checked items collection
- Programmatic checkbox state management
- Best practices for checkbox implementation

---

### Load on Demand

📄 **Read:** [references/load-on-demand.md](references/load-on-demand.md)

**When to read:** Implementing lazy loading of child nodes, handling large datasets, API-based hierarchies

**Covers:**
- Load on Demand implementation with LoadOnDemandCommand
- ShowExpanderAnimation for loading feedback
- PopulateChildNodes method
- Avoiding duplicate loading
- API-based lazy loading patterns
- Performance optimization with lazy loading

---

### Scrolling and Navigation

📄 **Read:** [references/scrolling-navigation.md](references/scrolling-navigation.md)

**When to read:** Programmatic scrolling, bringing items into view, keyboard navigation

**Covers:**
- BringIntoView method with all overloads
- Scroll position options (Start, Center, End, MakeVisible)
- Scroll animation control
- Horizontal scrolling configuration
- Scrollbar visibility control
- Keyboard navigation (arrow keys, Tab)
- Events (Loaded, ItemTapped, ItemDoubleTapped, ItemRightTapped)

---

### Item Height Customization

📄 **Read:** [references/item-height-customization.md](references/item-height-customization.md)

**When to read:** Customizing node heights, dynamic sizing, content-based measurements

**Covers:**
- Static ItemHeight property
- QueryNodeSize event for per-item heights
- NodeSizeMode property (Dynamic vs None)
- GetActualNodeHeight method
- Dynamic height calculation
- Performance considerations

---

### Empty View

📄 **Read:** [references/empty-view.md](references/empty-view.md)

**When to read:** Displaying empty states, customizing no-data UI, template-based empty views

**Covers:**
- Display string message when empty
- Display custom views in empty state
- EmptyViewTemplate for templated empty views
- Trigger conditions for empty view
- Binding in empty view templates
- Search/filter empty state patterns

---

### Advanced Features

📄 **Read:** [references/advanced-features.md](references/advanced-features.md)

**When to read:** Implementing load on demand, performance optimization, advanced TreeView operations

**Covers:**
- Load on demand for large datasets
- Empty view customization (EmptyView property)
- Scrolling configuration and optimization
- Working with TreeViewNode programmatically
- Checkbox support
- Events

---

### Troubleshooting

📄 **Read:** [references/troubleshooting.md](references/troubleshooting.md)

**When to read:** Debugging issues, resolving errors, optimization problems

**Covers:**
- Common TreeView issues and solutions
- Performance troubleshooting
- Data binding problems
- Selection not working
- Template rendering issues
- Expand/collapse problems
- Memory leaks and optimization
- Best practices checklist

---

More from syncfusion/maui-ui-components-skills

SkillDescription
syncfusion-maui-accordionImplements Syncfusion .NET MAUI Accordion (SfAccordion) - a vertically collapsible panel with stacked headers for expanding/collapsing content. Use when working with accordions, collapsible panels, expandable lists, employee lists with details, or FAQ sections in .NET MAUI applications. Covers AccordionItem configuration, expand modes, and grouped content display.
syncfusion-maui-ai-assistviewImplements Syncfusion .NET MAUI AI AssistView (SfAIAssistView) for AI-powered interactive chat interfaces. Use when working with AI chat interfaces, AI AssistView, SfAIAssistView, conversational UI, or chat with AI responses. Covers integrating AI services, creating chat UIs, implementing conversation flows, managing AI requests/responses, and displaying AI suggestions.
syncfusion-maui-autocompleteImplements and configure Syncfusion .NET MAUI Autocomplete (SfAutocomplete) control for intelligent text input with suggestions. Use when implementing autocomplete, autosuggest, type-ahead search, smart search, or filtered dropdowns in .NET MAUI applications. Covers data binding, filtering modes, custom search logic, AI-powered search, multi-selection with tokens, and UI customization.
syncfusion-maui-avatar-viewImplements Syncfusion .NET MAUI Avatar View (SfAvatarView) for displaying user profile pictures, initials, or group avatars. Use when working with avatar views, profile pictures, user images, initials display, profile icons, or contact images. Ideal for implementing user profile displays, contact lists, chat interfaces, or social feeds.
syncfusion-maui-backdropImplements Syncfusion .NET MAUI Backdrop Page (SfBackdropPage) with back layer and front layer surfaces. Use when working with backdrop pages, SfBackdropPage, back layer, front layer, or reveal/conceal animations. Covers backdrop navigation patterns, header icons, corner shapes, reveal height, layer state events, and liquid glass effect.
syncfusion-maui-badge-viewImplements Syncfusion .NET MAUI Badge View (SfBadgeView) control. Use when adding badge notifications, status indicators, unread counts, or notification overlays to MAUI applications. Covers SfBadgeView setup, badge text customization, position adjustments, animations, predefined symbols, and accessibility features.
syncfusion-maui-barcode-generatorImplements Syncfusion .NET MAUI Barcode Generator (SfBarcodeGenerator) for generating machine-readable barcodes. Use when working with barcodes, barcode generation, QR codes, data matrix, EAN codes, UPC codes, Code128, or Code39. This skill covers both one-dimensional (linear) and two-dimensional (matrix) barcode symbologies with extensive customization options.
syncfusion-maui-busy-indicatorImplements Syncfusion .NET MAUI Busy Indicator (SfBusyIndicator) for showing loading states, data processing, and app activity indicators. Use when displaying loading indicators, busy animations, activity spinners, or processing feedback in .NET MAUI apps. Covers busy indicator setup, animations, and visual feedback during long-running operations.
syncfusion-maui-buttonImplements and customize Syncfusion .NET MAUI Button (SfButton) control. Use when working with MAUI buttons, SfButton implementation, button customization, or visual states. Covers button icons, background images, RTL support, Liquid Glass effects, custom button views, button styling, events, and checkable buttons.
syncfusion-maui-calendarImplements and customize Syncfusion .NET MAUI Calendar (SfCalendar) control. Use when implementing calendar functionality, date selection (single, multiple, range), or calendar views (month, year, decade, century). Covers date restrictions (min/max dates, EnablePastDates, SelectableDayPredicate), calendar customization, events (ViewChanged, SelectionChanged, Tapped), and header/footer customization.