Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

syncfusion-blazor-treeview同步融合 Blazor 树视图

Agent Skill

syncfusion-blazor-treeview 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

979

周安装

40

GitHub Stars

公开资料未说明

下载量

317
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-blazor-treeview(同步融合 Blazor 树视图)
来源仓库:https://github.com/syncfusion/blazor-ui-components-skills
仓库路径:skills/syncfusion-blazor-treeview
安装命令:
npx skills add https://github.com/syncfusion/blazor-ui-components-skills --skill syncfusion-blazor-treeview
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/blazor-ui-components-skills --skill syncfusion-blazor-treeview

简介

为 Blazor 应用提供 Syncfusion TreeView 组件的详细集成指导。

  • 适合构建交互式 Web 前端中的层级导航与数据组织结构。
  • 涵盖模板定制、事件绑定与性能优化等关键开发要点。
  • 必须获得有效商业授权才能用于盈利性产品部署。syncfusion-blazor-treeview 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 可通过 npm 包管理器快速添加所需依赖文件。

SKILL.md

Implementing Syncfusion Blazor TreeView Component

The Blazor TreeView component displays hierarchical data in an expandable/collapsible tree structure. It supports local and remote data binding, single and multi-selection, editing, checkboxes, drag-drop reordering, virtualization for large datasets, filtering, and comprehensive event handling.


📋 Table of Contents

  1. When to Use
  2. Installation & Setup
  3. Quick Start
  4. Key Properties
  5. Key Methods
  6. Key Events
  7. Common Patterns
  8. Complete Reference Navigation

When to Use This Skill

Use the TreeView component when you need to:

  • Display hierarchical data in a tree structure with expandable/collapsible nodes
  • Single selection: Allow users to select one node from the tree
  • Multi-selection: Enable selection of multiple tree nodes using Ctrl+Click and Shift+Click
  • Checkbox selection: Provide checkbox-based multi-selection with automatic parent-child state management
  • Edit nodes: Allow inline renaming or editing of node text
  • Drag and drop: Enable reordering nodes within the hierarchy
  • Filter and search: Implement search functionality to find nodes
  • Remote data sources: Bind to Web APIs, OData services, or custom endpoints
  • Handle events: Respond to expand, collapse, select, edit, and drag-drop actions
  • Virtualization: Display large datasets (1000+ nodes) with smooth scrolling
  • Custom styling: Apply icons, colors, and templates for nodes

Installation & Setup

Install Syncfusion NuGet packages and configure your Blazor project:

// 1. Install NuGet packages
// Install-Package Syncfusion.Blazor.Navigations -Version 26.1.35
// Install-Package Syncfusion.Blazor.Themes -Version 26.1.35

// 2. Add to _Imports.razor
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Navigations

// 3. Register service in Program.cs
builder.Services.AddSyncfusionBlazor();

// 4. Add CSS theme to Index.html or _Layout.cshtml
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />

Quick Start

@using Syncfusion.Blazor.Navigations

<SfTreeView TValue="MailItem">
    <TreeViewFieldsSettings TValue="MailItem"
        Id="Id"
        Text="FolderName"
        Child="Children"
        DataSource="@MyFolder">
    </TreeViewFieldsSettings>
    <TreeViewEvents TValue="MailItem" NodeSelected="OnNodeSelected"></TreeViewEvents>
</SfTreeView>

@code {
    public class MailItem
    {
        public string? Id { get; set; }
        public string? FolderName { get; set; }
        public List<MailItem>? Children { get; set; }
    }

    void OnNodeSelected(NodeSelectEventArgs args)
    {
        Console.WriteLine($"Selected: {args.NodeData.Text}");
    }

    List<MailItem> MyFolder = new()
    {
        new MailItem { Id = "1", FolderName = "Inbox", Children = new() },
        new MailItem { Id = "2", FolderName = "Sent", Children = new() }
    };
}

Key Properties

PropertyTypeDefaultPurpose
AllowDragAndDropboolfalseEnable/disable drag-drop hierarchy reordering
AllowEditingboolfalseAllow double-click node renaming
AllowMultiSelectionboolfalseEnable Ctrl+Click multi-selection
ShowCheckBoxboolfalseDisplay checkboxes for each node
AutoCheckbooltrueAuto-check/uncheck children when parent checked
EnablePersistenceboolfalsePersist expanded/selected/checked state to localStorage
EnableVirtualizationboolfalseVirtual scrolling for 1000+ nodes (requires Height)
ExpandedNodesstring[]EmptyInitially expanded node IDs (2-way bindable)
SelectedNodesstring[]EmptySelected node IDs (2-way bindable)
CheckedNodesstring[]EmptyChecked node IDs (2-way bindable)
LoadOnDemandbooltrueLoad children only when node expands
ExpandOnExpandActionClickTrigger expand on Click/DoubleClick/None
Heightstring"auto"Fixed height (required for virtualization)

Key Methods

MethodPurpose
ExpandAllAsync()Expand all nodes
ExpandAllAsync(string[] nodeIds)Expand specific nodes by ID
CollapseAllAsync()Collapse all nodes
CollapseAllAsync(string[] nodeIds)Collapse specific nodes
BeginEditAsync(string nodeId)Enter edit mode for a node
GetTreeData()Get all tree data
GetTreeData(string nodeId)Get specific node data by ID
EnsureVisibleAsync(string nodeId)Scroll to make node visible
CheckAllAsync()Check all checkboxes
UncheckAllAsync()Uncheck all checkboxes
ClearStateAsync()Clear all state (selection, expand, check)

Key Events

EventFires WhenCommon Uses
CreatedTreeView initializedPost-initialization setup, load preferences
DataBoundData binding completeAuto-expand default nodes, validate data
NodeSelectedNode left-clickedLoad node details, enable actions
NodeClickedNode clickedDistinguish single vs double-click
NodeExpandedNode expandedLoad child nodes (load-on-demand)
NodeCollapsedNode collapsedOptional: Unload children from memory
NodeEditingBefore edit modeValidate permissions, prevent edits
NodeEditedEdit confirmedValidate new text, save to server
OnNodeDragStartDrag beginsPrevent dragging restricted nodes
NodeDroppedDrop completedUpdate hierarchy in server
NodeCheckingBefore checkbox changesPrevent checking restricted nodes
NodeCheckedCheckbox changedUpdate related data, trigger actions
DataSourceChangedData source updatedRe-apply filters, refresh calculations
OnActionFailureAction fails (API error)Recover from errors, show notifications
OnKeyPressKey pressedImplement keyboard shortcuts (Delete, F2, etc)

Common Patterns

Pattern 1: Basic Selection

<SfTreeView TValue="Item" @bind-SelectedNodes="@SelectedIds">
    <TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
    <TreeViewEvents TValue="Item" NodeSelected="OnSelect"></TreeViewEvents>
</SfTreeView>

@code {
    string[] SelectedIds = Array.Empty<string>();
    void OnSelect(NodeSelectEventArgs args) => Console.WriteLine(args.NodeData.Text);
}

Pattern 2: Multiple Selection

<SfTreeView TValue="Item" AllowMultiSelection="true" @bind-SelectedNodes="@SelectedIds">
    <TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
</SfTreeView>

Pattern 3: Load on Demand

void OnNodeExpanded(NodeExpandEventArgs args)
{
    if (args.NodeData.HasChild && args.NodeData.Child == null)
    {
        // Load children from API
        args.NodeData.Child = await FetchChildren(args.NodeData.Id);
    }
}

Pattern 4: Drag and Drop

<SfTreeView TValue="Item" AllowDragAndDrop="true">
    <TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
    <TreeViewEvents TValue="Item" NodeDropped="OnDropped"></TreeViewEvents>
</SfTreeView>

void OnDropped(DragAndDropEventArgs args) => UpdateHierarchy(args);

Pattern 5: Node Editing

<SfTreeView TValue="Item" AllowEditing="true" DoubleClickAction="DoubleClickAction.Edit">
    <TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
    <TreeViewEvents TValue="Item" NodeEdited="OnEdited"></TreeViewEvents>
</SfTreeView>

void OnEdited(NodeEditEventArgs args) => SaveChanges(args.NodeData);

Pattern 6: Checkboxes

<SfTreeView TValue="Item" AllowCheckBoxes="true" ChildChecking="ChildCheckState.Both">
    <TreeViewFieldsSettings TValue="Item" DataSource="@Items" />
</SfTreeView>

var checked = treeRef.GetAllCheckedNodes();

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Installation and NuGet package setup
  • Project configuration by type (WebAssembly, Server, Web App, MAUI)
  • CSS theme configuration
  • Service registration and first TreeView component

Data Binding and Sources

📄 Read: references/data-binding.md

  • Local data binding (hierarchical and self-referential structures)
  • Remote data with OData, OData V4, and Web API adaptors
  • Load on Demand for large datasets
  • TreeViewFieldsSettings property mappings
  • DataBound event for post-binding operations

Node Selection

📄 Read: references/node-selection.md

  • Single node selection (default behavior)
  • Multi-selection with AllowMultiSelection property
  • Accessing selected node data via NodeSelected event
  • Programmatic selection using SelectedNodes binding
  • Selection validation and conditional selection

Expand and Collapse Actions

📄 Read: references/expand-collapse-actions.md

  • Expand/collapse methods (ExpandAllAsync, CollapseAllAsync)
  • ExpandedNodes two-way binding for programmatic control
  • Initial expand state via data source
  • Expand/collapse animations with TreeViewNodeAnimationSettings
  • Load-on-demand child node loading via NodeExpanded event

Node Editing

📄 Read: references/node-editing.md

  • Enable editing with AllowEditing property
  • Double-click to enter edit mode
  • BeginEditAsync method for programmatic edit entry
  • NodeEditing and NodeEdited events for validation
  • Rename operations with conflict detection

Checkbox Features

📄 Read: references/checkbox-features.md

  • ShowCheckBox property for multi-item selection
  • AutoCheck for automatic parent-child synchronization
  • CheckedNodes two-way binding for programmatic control
  • Getting checked nodes with filtering and iteration
  • Permissions and role-based checkbox patterns

Events and Callbacks

📄 Read: references/events-handling.md

  • Lifecycle events (Created, DataBound)
  • Selection events (NodeSelected, SelectedNodesChanged)
  • Expand/collapse events (NodeExpanded, NodeCollapsed)
  • Edit events (NodeEditing, NodeEdited)
  • Checkbox events (NodeChecking, NodeChecked)
  • Drag-drop events (OnNodeDragStart, NodeDropped)
  • Keyboard shortcuts (Enter, Delete, F2, Arrow keys)

Advanced Features

📄 Read: references/advanced-features.md

  • Drag-and-drop with hierarchy reordering
  • UI virtualization for 1000+ nodes
  • Search and filtering functionality
  • Sorting (Ascending, Descending, None)
  • Performance optimization techniques

Customization and Styling

📄 Read: references/customization-styling.md

  • Icon customization (expand/collapse, node icons)
  • Dynamic icons based on data
  • Text wrapping and display formatting
  • CSS styling with e-icons classes
  • Theme support and responsive design

Authorization and Security

📄 Read: references/authorization-authentication.md

  • Authentication setup with AuthorizeView
  • Role-based authorization and permissions
  • Node-level access control
  • Claims-based authorization patterns
  • Securing edit operations and drag-drop

Navigation Patterns

📄 Read: references/navigation-patterns.md

  • Node traversal methods (parent, children, siblings)
  • Breadcrumb navigation implementation
  • NavigateUrl property for node links
  • Parent-child navigation relationships
  • Deep-linking to specific nodes

Quick Links and Real-World Examples

Need help? Start with:

  1. Quick Start - Get running in 5 minutes
  2. Common Patterns - Copy-paste patterns for your use case
  3. Key Properties - Find property details
  4. data-binding.md - Learn data binding approaches
  5. events-handling.md - Understand all events

Real-world implementations:

  • File Browser: Use hierarchical data + expand-collapse + icons + drag-drop
  • Organization Chart: Use data-binding + templates + multi-level navigation
  • Navigation Menu: Use hierarchical data + keyboard navigation + load-on-demand
  • Category Filter: Use self-referential data + checkboxes + filtering
  • Permissions UI: Use checkboxes + AutoCheck + role-based authorization

Summary

This skill provides comprehensive guidance for implementing the Syncfusion Blazor TreeView component. Use the Documentation and Navigation Guide section above to find the specific reference file you need based on your use case.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.86%
按下载量换算111

Claude

32.93%
按下载量换算104

Cursor

20.19%
按下载量换算64

Gemini CLI

9.49%
按下载量换算30

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills