syncfusion-uwp-spreadsheet-editor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Syncfusion UWP Spreadsheet Editor

Syncfusion UWP Spreadsheet 编辑器

Overview

概述

Build Excel-like spreadsheet applications in UWP using Syncfusion SfSpreadsheet control with full support for workbook operations, formulas, charts, data validation, and ribbon customization.
借助Syncfusion SfSpreadsheet控件在UWP中构建类Excel的表格应用,全面支持工作簿操作、公式、图表、数据验证和功能区自定义。

Key Capabilities

核心功能

  • Workbook Operations: Create/open/save Excel files (XLS, XLSX, XLSM, CSV), multiple worksheets, freeze panes, zoom, protection
  • Cell Operations: Editing, formatting (fonts, colors, borders, alignment), merge cells, comments, hyperlinks, bookmarks
  • Data Features: 400+ Excel-compatible formulas, named ranges, data validation, conditional formatting, fill series
  • Advanced Features: Charts, sparklines, clipboard operations, undo/redo, grouping/outlines
  • 工作簿操作:创建/打开/保存Excel文件(XLS、XLSX、XLSM、CSV)、多工作表、冻结窗格、缩放、保护
  • 单元格操作:编辑、格式化(字体、颜色、边框、对齐方式)、合并单元格、批注、超链接、书签
  • 数据特性:400+兼容Excel的公式、命名区域、数据验证、条件格式化、填充序列
  • 高级特性:图表、迷你图、剪贴板操作、撤销/重做、分组/大纲

Quick Start Examples

快速开始示例

Example 1

示例1

User: "Show me how to create a spreadsheet with data and formulas"
Result: C# code generated to create workbook, set cell values, and add formulas
用户:"展示如何创建带有数据和公式的表格"
结果:生成用于创建工作簿、设置单元格值和添加公式的C#代码

Example 2

示例2

User: "Add data validation and rules in the spreadsheet control"
Result: C# code generated for spreadsheet control validation and custom rules

用户:"在表格控件中添加数据验证和规则"
结果:生成用于表格控件验证和自定义规则的C#代码

Generate UWP Code — Workflow

生成UWP代码 — 工作流

Trigger keywords: "how to", "add spreadsheet", "code sample", "show me", "example", "snippet", "integrate", "component", "create sample", "code", "sample code", "generate code", "implement", "add to project", "configure spreadsheet"
触发关键词:"how to"、"add spreadsheet"、"code sample"、"show me"、"example"、"snippet"、"integrate"、"component"、"create sample"、"code"、"sample code"、"generate code"、"implement"、"add to project"、"configure spreadsheet"

Step 1: Ask User for Delivery Option

步骤1:询问用户交付选项

Before showing code, ask:
"How would you like me to provide the solution?

Option 1: Create a new file in skill folder (.codestudio/skills/syncfusion-uwp-spreadsheet-editor/output/)
Option 2: Add code to an existing file in your project (you provide the file path)
Option 3: Just show the code (no files created/modified)

Please select Option 1, 2, or 3."
⏸️ WAIT for explicit user selection before proceeding.
展示代码前,请询问:
"您希望我以何种方式提供解决方案?

选项1:在Skill文件夹中创建新文件(.codestudio/skills/syncfusion-uwp-spreadsheet-editor/output/)
选项2:将代码添加到项目中已有的文件(请提供文件路径)
选项3:仅展示代码(不创建/修改任何文件)

请选择选项1、2或3。"
⏸️ 等待用户明确选择后再继续。

Step 2: Generate Code from Reference Files

步骤2:从参考文件生成代码

  • Read relevant
    references/*.md
    file(s) for requested feature
  • Build C# and/or XAML code using ONLY snippets from reference files
  • Do NOT show code yet, do NOT create files yet
  • 读取与请求功能相关的
    references/*.md
    文件
  • 仅使用参考文件中的代码片段构建C#和/或XAML代码
  • 暂不展示代码,也暂不创建文件

Step 3: Handle User Selection

步骤3:处理用户选择

Option 1: Show code → automatically save to
.codestudio/skills/syncfusion-uwp-spreadsheet-editor/output/
(skill folder only) Option 2: Ask for file path → show code → wait for explicit YES confirmation → apply code → ask to build Option 3: Show code with summary and required assemblies → done (no files created/modified)
  • For Option 2 only: Before generating code, check if the project has the prerequisites from
    references/gettingstarted.md
    (Prerequisites and Setup Requirements section). If missing, ask user consent and add them.

选项1:展示代码 → 自动保存到
.codestudio/skills/syncfusion-uwp-spreadsheet-editor/output/
(仅Skill文件夹) 选项2:询问文件路径 → 展示代码 → 等待用户明确确认“YES” → 应用代码 → 询问是否构建 选项3:展示代码及摘要和所需程序集 → 完成(不创建/修改任何文件)
  • 仅针对选项2:生成代码前,检查项目是否满足
    references/gettingstarted.md
    中(前提条件和设置要求部分)的依赖项。若缺失,需征得用户同意后添加。

Out-of-Scope Requests

超出范围的请求

When a user asks a question that does NOT match the skill domain (i.e., not related to UWP Spreadsheet, Excel processing, or Syncfusion spreadsheet control), respond with:
"Unable to process the input. Please provide the input in a different way."
Do NOT attempt to:
  • Generate code outside the spreadsheet/Excel domain
  • Provide general UWP guidance unrelated to spreadsheet functionality
  • Process requests for other Syncfusion controls or unrelated frameworks
  • Assist with non-spreadsheet features
ONLY activate this skill and its workflows when the user's request matches trigger keywords: "spreadsheet", "Excel", "UI", "code", "Ribbon", "UWP" (in context of spreadsheet/Excel).

当用户提出的问题不属于本Skill的领域(即与UWP表格、Excel处理或Syncfusion表格控件无关),请回复:
"无法处理该输入,请更换方式提供输入。"
请勿尝试:
  • 生成表格/Excel领域以外的代码
  • 提供与表格功能无关的通用UWP指导
  • 处理其他Syncfusion控件或无关框架的请求
  • 协助处理非表格类功能
仅当用户请求匹配触发关键词时,才激活本Skill及其工作流:"spreadsheet"、"Excel"、"UI"、"code"、"Ribbon"、"UWP"(在表格/Excel相关语境下)。

Code References

代码参考

All templates and feature snippets live in
references/*.md
. Each file is a focused snippet the agent combines when generating samples.
Flow: Always start with
references/gettingstarted.md
(Prerequisites and Setup Requirements section), then merge matched feature snippets. If no feature keywords match, return only the basic sample.
FileContents
gettingstarted.mdNuGet packages check, XAML setup, namespaces, create/open/save workbook, basic spreadsheet code
localization.mdSupported languages, culture settings, localized UI strings, RTL support, number/date/currency formatting, dynamic language switching
ribboncustomization.mdAdd custom ribbon tabs, add items to existing tabs, remove ribbon tabs and items, ribbon customization patterns
worksheetmanagement.mdInsert/delete/rename/hide/unhide sheets, protection (sheets and workbooks), gridlines, headings, zooming
editing.mdEnable/disable editing, edit cells programmatically, locking/unlocking cells, editing events, data validation (number, date, text, list, custom formula), hyperlinks
selection.mdEnable/disable selection, access current cell, get selected ranges, add/clear selections, move current cell, convert GridRangeInfo and IRange, selection events, keyboard navigation
findandreplace.mdFind All, Find Next, Find Conditional Formatting, Find Constants, Find Formulas, Find Data Validation, Replace All, Replace operations
formulas.mdAdd formulas to cells, 409+ built-in functions (database, date/time, math, text, logical, lookup, statistical, financial, information), named ranges, formula calculation engine
customformula.mdRegister custom formulas, add custom formulas to FormulaEngine, implement custom formula logic, use custom formulas in cells
formatting.mdCell background color, font formatting, cell borders, cell alignment, text wrapping, merge/unmerge cells, number formatting, built-in styles, format as table, clear formatting
rowsandcolumns.mdInsert/delete rows and columns, row height and column width, hide/show rows and columns, freeze/unfreeze panes, auto-fit rows and columns
conditionalformatting.mdHighlight cell rules (values, formulas, text, time periods), data bars, color scales, icon sets, comparison operators, format types, time period types
interactivefeatures.mdClipboard operations (cut, copy, paste, paste options in pogrammatically), undo/redo functionality, context menu customization, cell comments
outline.mdGroup/ungroup rows and columns, expand/collapse groups, outline settings, clear all outlines
shapes.md⚠️ REQUIRED for graphic elements: Charts (register
GraphicChartCellRenderer
), sparklines (register
SparklineCellRenderer
), pictures (add at runtime), text boxes, select shapes, clear shape selection
workingwithsfspreadsheet.mdAccess workbook/worksheets, access SpreadsheetGrid, workbook load/unload events, set active sheet, access cells and ranges, set/clear cell values, refresh view, scrolling, formula bar visibility, workbook modification check, suppress alerts, suspend/resume formula calculation, popup management

所有模板和功能代码片段均存储在
references/*.md
中。Agent会在生成示例时组合这些聚焦的代码片段。
流程:始终从
references/gettingstarted.md
(前提条件和设置要求部分)开始,然后合并匹配的功能代码片段。若没有匹配的功能关键词,仅返回基础示例。
文件内容
gettingstarted.mdNuGet包检查、XAML设置、命名空间、创建/打开/保存工作簿、基础表格代码
localization.md支持的语言、区域设置、本地化UI字符串、RTL支持、数字/日期/货币格式化、动态语言切换
ribboncustomization.md添加自定义功能区选项卡、向现有选项卡添加项、移除功能区选项卡和项、功能区自定义模式
worksheetmanagement.md插入/删除/重命名/隐藏/取消隐藏工作表、保护(工作表和工作簿)、网格线、标题、缩放
editing.md启用/禁用编辑、以编程方式编辑单元格、锁定/解锁单元格、编辑事件、数据验证(数字、日期、文本、列表、自定义公式)、超链接
selection.md启用/禁用选择、访问当前单元格、获取选中区域、添加/清除选择、移动当前单元格、转换GridRangeInfo和IRange、选择事件、键盘导航
findandreplace.md查找全部、查找下一个、查找条件格式、查找常量、查找公式、查找数据验证、替换全部、替换操作
formulas.md向单元格添加公式、409+内置函数(数据库、日期/时间、数学、文本、逻辑、查找、统计、财务、信息)、命名区域、公式计算引擎
customformula.md注册自定义公式、向FormulaEngine添加自定义公式、实现自定义公式逻辑、在单元格中使用自定义公式
formatting.md单元格背景色、字体格式化、单元格边框、单元格对齐方式、文本换行、合并/取消合并单元格、数字格式化、内置样式、表格格式化、清除格式化
rowsandcolumns.md插入/删除行和列、行高和列宽、隐藏/显示行和列、冻结/取消冻结窗格、自动调整行和列
conditionalformatting.md突出显示单元格规则(值、公式、文本、时间段)、数据条、色阶、图标集、比较运算符、格式类型、时间段类型
interactivefeatures.md剪贴板操作(以编程方式执行剪切、复制、粘贴、粘贴选项)、撤销/重做功能、上下文菜单自定义、单元格批注
outline.md分组/取消分组行和列、展开/折叠组、大纲设置、清除所有大纲
shapes.md**⚠️ 图形元素必备:**图表(注册
GraphicChartCellRenderer
)、迷你图(注册
SparklineCellRenderer
)、图片(运行时添加)、文本框、选择形状、清除形状选择
workingwithsfspreadsheet.md访问工作簿/工作表、访问SpreadsheetGrid、工作簿加载/卸载事件、设置活动工作表、访问单元格和区域、设置/清除单元格值、刷新视图、滚动、公式栏可见性、工作簿修改检查、抑制警报、暂停/恢复公式计算、弹窗管理

Rules

规则

  1. Use Only Reference Snippets
    • Generate code exclusively from the Markdown files under
      references/
    • Do not invent/guess/include any properties, events, API methods, component names, or parameters not present in
      references/*.md
  2. NO FILE MODIFICATIONS WITHOUT PERMISSION
    • Never create or modify files/folders in user workspace without explicit user selection and confirmation.
    • Cannot create StackPanel, buttons, textblocks, dialogs, MessageBox or any UI elements beyond the Spreadsheet without user permission.
  3. Unsupported Feature Handling
    • If the user requests a feature with no corresponding snippet in
      references/*.md
      , respond with:
      That feature is not currently supported by the Syncfusion UWP Spreadsheet component.
    • Suggest the closest supported features only if they have snippets
    • Explicitly list unsupported items and do not synthesize code for them
  4. Validation Before Write
    • Re-validate before writing that all code blocks originate from
      references/*.md
      files
    • If validation fails, stop and inform the user

  1. 仅使用参考代码片段
    • 代码生成必须完全来自
      references/
      下的Markdown文件
    • 不得自行发明/猜测/包含任何
      references/*.md
      中未提及的属性、事件、API方法、组件名称或参数
  2. 未经许可不得修改文件
    • 未经用户明确选择和确认,不得在用户工作区中创建或修改任何文件/文件夹
    • 未经用户许可,不得创建StackPanel、按钮、文本块、对话框、MessageBox或任何表格以外的UI元素
  3. 不支持特性的处理
    • 如果用户请求的特性在
      references/*.md
      中没有对应的代码片段,请回复:
      该特性目前不受Syncfusion UWP Spreadsheet组件支持。
    • 仅当存在对应代码片段时,才建议最接近的支持特性
    • 明确列出不支持的项,不得合成相关代码
  4. 写入前验证
    • 写入前重新验证所有代码块均来自
      references/*.md
      文件
    • 若验证失败,停止操作并告知用户