syncfusion-maui-datagrid
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing .NET MAUI DataGrid
实现.NET MAUI DataGrid
A comprehensive skill for implementing and customizing the Syncfusion .NET MAUI DataGrid (SfDataGrid) control. The DataGrid displays and manipulates data in a tabular format with support for columns, editing, sorting, filtering, grouping, summaries, paging, and export features.
这是一项用于实现和自定义Syncfusion .NET MAUI DataGrid(SfDataGrid)控件的全面技能。该DataGrid以表格格式展示和操作数据,支持列配置、编辑、排序、筛选、分组、汇总、分页以及导出功能。
When to Use This Skill
何时使用此技能
Use this skill when you need to:
- Display tabular data in a .NET MAUI application
- Bind data sources (IEnumerable, ObservableCollection, DataTable) to a grid
- Configure columns (auto-generated or manual)
- Implement cell editing and validation
- Add sorting, filtering, or searching functionality
- Group data and display summaries/aggregates
- Implement paging or incremental loading
- Enable row operations (drag-drop, swipe, add/delete)
- Export grid data to Excel or PDF
- Customize grid appearance and behavior
- Optimize performance for large datasets
- Implement master-detail views or custom row templates
当你需要以下操作时使用此技能:
- 在.NET MAUI应用中展示表格数据
- 将数据源(IEnumerable、ObservableCollection、DataTable)绑定到网格
- 配置列(自动生成或手动定义)
- 实现单元格编辑与验证
- 添加排序、筛选或搜索功能
- 对数据进行分组并展示汇总/聚合结果
- 实现分页或增量加载
- 启用行操作(拖拽、滑动、添加/删除)
- 将网格数据导出至Excel或PDF
- 自定义网格外观与行为
- 针对大型数据集优化性能
- 实现主从视图或自定义行模板
Component Overview
组件概述
SfDataGrid is a high-performance data grid control for .NET MAUI that provides:
Core Features:
- Multiple data binding options (IEnumerable, DataTable, dynamic objects)
- Auto-generated or manually defined columns
- 8+ column types (Text, Numeric, Date, Checkbox, Image, ComboBox, Picker, Template)
- In-cell editing with validation
- Multi-column sorting and filtering
- Interactive grouping with summaries
- Selection modes (Single, Multiple, None)
- Paging and data virtualization
- Excel and PDF export
- Advanced views (Master-Details, Record Templates)
NuGet Package:
Syncfusion.Maui.DataGridSfDataGrid 是一款适用于.NET MAUI的高性能数据网格控件,提供以下功能:
核心特性:
- 多种数据绑定选项(IEnumerable、DataTable、动态对象)
- 自动生成或手动定义列
- 8种以上列类型(文本、数值、日期、复选框、图片、ComboBox、Picker、模板)
- 带验证的单元格内编辑
- 多列排序与筛选
- 带汇总的交互式分组
- 选择模式(单选、多选、无选择)
- 分页与数据虚拟化
- Excel和PDF导出
- 高级视图(主从视图、记录模板)
NuGet包:
Syncfusion.Maui.DataGridDocumentation and Navigation Guide
文档与导航指南
Getting Started & Data Binding
入门与数据绑定
📄 Read: references/getting-started.md
- Installation and NuGet package setup
- Handler registration in MauiProgram.cs
- Basic DataGrid implementation (XAML & C#)
- Creating data models and ViewModels
- Binding with IEnumerable and ObservableCollection
- Binding with DataTable and dynamic objects
- Initial configuration and first steps
📄 阅读: references/getting-started.md
- 安装与NuGet包设置
- 在MauiProgram.cs中注册处理器
- DataGrid基础实现(XAML和C#)
- 创建数据模型与ViewModel
- 绑定IEnumerable和ObservableCollection
- 绑定DataTable与动态对象
- 初始配置与入门步骤
Columns & Column Configuration
列与列配置
📄 Read: references/columns.md
- Auto-generating columns (AutoGenerateColumnsMode)
- Manually defining columns
- Column types (Text, Numeric, Date, Checkbox, Image, ComboBox, Picker, Template)
- Column properties (MappingName, HeaderText, Format, Width)
- Column sizing and width options
- Column visibility and ordering
- AutoGenerateColumnsMode options (None, Reset, ResetAll, RetainOld)
📄 阅读: references/columns.md
- 自动生成列(AutoGenerateColumnsMode)
- 手动定义列
- 列类型(文本、数值、日期、复选框、图片、ComboBox、Picker、模板)
- 列属性(MappingName、HeaderText、Format、Width)
- 列大小调整与宽度选项
- 列可见性与排序
- AutoGenerateColumnsMode选项(None、Reset、ResetAll、RetainOld)
Column Operations
列操作
📄 Read: references/column-operations.md
- Column resizing (manual and auto-fit)
- Column drag and drop (reordering)
- Stacked headers (multi-level column headers)
- Unbound columns (calculated/expression columns)
- Freeze panes (frozen columns)
- Column customization and events
📄 阅读: references/column-operations.md
- 列调整大小(手动与自动适配)
- 列拖拽(重新排序)
- 堆叠表头(多级列标题)
- 非绑定列(计算/表达式列)
- 冻结窗格(冻结列)
- 列自定义与事件
Cell Editing
单元格编辑
📄 Read: references/editing.md
- Enabling editing (AllowEditing, NavigationMode, SelectionMode)
- Column-level editing control
- Edit modes and triggers
- Cell editing events (BeginEdit, EndEdit, CellValueChanged)
- Programmatic editing
- Enter key and Tab navigation during editing
📄 阅读: references/editing.md
- 启用编辑(AllowEditing、NavigationMode、SelectionMode)
- 列级编辑控制
- 编辑模式与触发条件
- 单元格编辑事件(BeginEdit、EndEdit、CellValueChanged)
- 程序化编辑
- 编辑期间的回车键与Tab键导航
Data Validation
数据验证
📄 Read: references/data-validation.md
- Cell value validation
- Row-level validation
- Custom validation logic
- Validation events
- Error handling and display
- IDataErrorInfo support
📄 阅读: references/data-validation.md
- 单元格值验证
- 行级验证
- 自定义验证逻辑
- 验证事件
- 错误处理与展示
- IDataErrorInfo支持
Sorting & Filtering
排序与筛选
📄 Read: references/sorting-filtering.md
- Single and multi-column sorting
- Custom sorting logic
- Programmatic sorting
- Sort icons and UI customization
- Filtering basics and filter types
- Filter row implementation
- Programmatic filtering
- Custom filter predicates
📄 阅读: references/sorting-filtering.md
- 单列与多列排序
- 自定义排序逻辑
- 程序化排序
- 排序图标与UI自定义
- 筛选基础与筛选类型
- 筛选行实现
- 程序化筛选
- 自定义筛选谓词
Searching
搜索
📄 Read: references/searching.md
- Search functionality setup
- Text search and highlighting
- Case sensitivity options
- Search navigation (next/previous)
- Programmatic search control
📄 阅读: references/searching.md
- 搜索功能设置
- 文本搜索与高亮
- 大小写敏感选项
- 搜索导航(下一个/上一个)
- 程序化搜索控制
Grouping & Summaries
分组与汇总
📄 Read: references/grouping-summaries.md
- Data grouping (single and multi-column)
- Group expand/collapse behavior
- Custom grouping logic
- Group header customization
- Summary rows (Table, Group, Caption summaries)
- Built-in aggregate functions (Sum, Average, Count, Min, Max)
- Custom summary calculations
- Summary display formatting
📄 阅读: references/grouping-summaries.md
- 数据分组(单列与多列)
- 组展开/折叠行为
- 自定义分组逻辑
- 组标题自定义
- 汇总行(表格、组、标题汇总)
- 内置聚合函数(求和、平均值、计数、最小值、最大值)
- 自定义汇总计算
- 汇总显示格式
Selection & Navigation
选择与导航
📄 Read: references/selection.md
- Selection modes (Single, Multiple, SingleDeselect, None)
- Row and cell selection
- Selection events (SelectionChanging, SelectionChanged)
- Programmatic selection
- Current cell vs selected items
- Keyboard navigation (Windows platform)
📄 阅读: references/selection.md
- 选择模式(单选、多选、单选取消、无选择)
- 行与单元格选择
- 选择事件(SelectionChanging、SelectionChanged)
- 程序化选择
- 当前单元格与选中项
- 键盘导航(Windows平台)
Paging & Data Virtualization
分页与数据虚拟化
📄 Read: references/paging-virtualization.md
- Paging setup and configuration
- Page size and page count
- Page navigation controls
- Custom paging UI
- Load More (incremental loading)
- Pull to Refresh
- Data virtualization for performance
- Large dataset handling
📄 阅读: references/paging-virtualization.md
- 分页设置与配置
- 页面大小与页数
- 页面导航控件
- 自定义分页UI
- 加载更多(增量加载)
- 下拉刷新
- 数据虚拟化以提升性能
- 大型数据集处理
Row Operations
行操作
📄 Read: references/row-operations.md
- Row height customization
- Auto row height (QueryRowHeight event)
- Row drag and drop
- Row swiping actions
- Adding new rows programmatically
- Deleting rows
- Unbound rows (additional summary rows at top/bottom)
- Row-level events
📄 阅读: references/row-operations.md
- 行高自定义
- 自动行高(QueryRowHeight事件)
- 行拖拽
- 行滑动操作
- 程序化添加新行
- 删除行
- 非绑定行(顶部/底部的额外汇总行)
- 行级事件
Exporting & Clipboard
导出与剪贴板
📄 Read: references/exporting.md
- Export to Excel functionality
- Excel export customization (columns, rows, styling)
- Excel export options and events
- Export to PDF functionality
- PDF export customization
- Clipboard operations (copy/paste)
- Custom clipboard formats
📄 阅读: references/exporting.md
- Excel导出功能
- Excel导出自定义(列、行、样式)
- Excel导出选项与事件
- PDF导出功能
- PDF导出自定义
- 剪贴板操作(复制/粘贴)
- 自定义剪贴板格式
Advanced Features & Views
高级特性与视图
📄 Read: references/advanced-features.md
- Master-Details View (hierarchical/relational data)
- Record Template View (custom row layouts)
- Empty view customization
- Context menu implementation
- Tooltips for cells
- Merged cells
- Serialization (save/load grid state)
- Conditional styling by data
📄 阅读: references/advanced-features.md
- 主从视图(分层/关联数据)
- 记录模板视图(自定义行布局)
- 空视图自定义
- 上下文菜单实现
- 单元格工具提示
- 合并单元格
- 序列化(保存/加载网格状态)
- 基于数据的条件样式
Styling & Customization
样式与自定义
📄 Read: references/styling-customization.md
- Grid styling basics
- Cell styling (CellStyle)
- Conditional cell styling
- Row styling and alternating row colors
- Header styling
- Theme customization
- Custom cell templates
- Liquid glass effect
📄 阅读: references/styling-customization.md
- 网格样式基础
- 单元格样式(CellStyle)
- 条件单元格样式
- 行样式与交替行颜色
- 表头样式
- 主题自定义
- 自定义单元格模板
- 液态玻璃效果
Performance & Events
性能与事件
📄 Read: references/performance-events.md
- Performance optimization techniques
- Large dataset best practices
- Memory management strategies
- Grid events overview
- Common event scenarios
- Event handling patterns
- Performance monitoring
📄 阅读: references/performance-events.md
- 性能优化技巧
- 大型数据集最佳实践
- 内存管理策略
- 网格事件概述
- 常见事件场景
- 事件处理模式
- 性能监控
Localization
本地化
📄 Read: references/localization.md
- Localization setup
- Multi-language support
- RTL (Right-to-Left) support
- Scrolling modes and optimization
📄 阅读: references/localization.md
- 本地化设置
- 多语言支持
- RTL(从右到左)支持
- 滚动模式与优化