syncfusion-winforms-pivot-grid
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSyncfusion Windows Forms Pivot Grid
Syncfusion Windows Forms Pivot Grid
The Syncfusion Windows Forms Pivot Grid control is a powerful, Excel-like pivot table component that enables interactive data analysis and cross-tabulated reporting. It transforms large datasets into meaningful summaries with drag-and-drop field organization, drill-down navigation, and advanced calculations.
Syncfusion Windows Forms Pivot Grid控件是一个功能强大、类Excel的透视表组件,支持交互式数据分析和交叉表报告生成。它可通过拖放字段组织、钻取导航和高级计算,将大型数据集转换为有意义的汇总信息。
When to Use This Skill
何时使用本技能
Use this skill when you need to:
- Implement pivot table functionality in Windows Forms applications
- Build business intelligence dashboards with data summarization
- Create analytical reports with hierarchical grouping and calculations
- Provide interactive data exploration with drill-down/drill-up navigation
- Display cross-tabulated data from relational or OLAP sources
- Enable users to dynamically reorganize data fields
- Export pivot analysis to Excel, PDF, or Word formats
- Apply conditional formatting based on cell values
- Implement custom aggregations and calculated fields
- Build financial reports, sales dashboards, or KPI tracking interfaces
当你需要以下功能时,可使用本技能:
- 在Windows Forms应用中实现透视表功能
- 构建具备数据汇总能力的商业智能仪表板
- 创建包含分层分组和计算功能的分析报告
- 提供支持钻取/钻取导航的交互式数据探索功能
- 展示来自关系型或OLAP数据源的交叉表数据
- 允许用户动态重新组织数据字段
- 将透视分析结果导出为Excel、PDF或Word格式
- 根据单元格值应用条件格式
- 实现自定义聚合和计算字段
- 构建财务报告、销售仪表板或KPI跟踪界面
Component Overview
组件概述
Key Features:
- Excel-Like Pivot Tables - Familiar interface for data pivoting and analysis
- Interactive Schema Designer - Built-in Pivot Table Field List for drag-and-drop field management
- Multiple Data Sources - Supports IList, IEnumerable, DataTable, DataView, OLAP
- Drill-Down Navigation - Interactive expansion/collapse of hierarchical data
- Advanced Calculations - Sum, Average, Count, Min, Max, custom expressions, running totals
- Filtering & Sorting - Label filters, value filters, multi-level sorting
- Grouping Bar - Visual field organization with drag-and-drop
- Conditional Formatting - Style cells based on rules and conditions
- Export Capabilities - Export to Excel, PDF, Word with formatting preserved
- Cell Selection - Single, multiple, range selection modes
- Editing Support - Modify cell values and update aggregations
- Touch Support - Touch-friendly interactions for tablet devices
- Localization - Multi-language support
Namespace:
Syncfusion.Windows.Forms.PivotAnalysisAssembly Dependencies:
Syncfusion.Grid.Windows.dllSyncfusion.PivotAnalysis.Base.dllSyncfusion.PivotAnalysis.Windows.dllSyncfusion.Shared.Base.dll
NuGet Guidance:
- Install the latest available version of Syncfusion.PivotTable.WinForms
- Prefer NuGet package references over manual DLL references when possible
- Verify package compatibility with the project target framework before upgrading
Important UI Setup Note:
- Always create the control with when working inside a WinForms form.
new PivotGridControl(this.components); - Always set and
Locationfirst, and ensure the control is larger than 300 x 300 before enablingSize.ShowPivotTableFieldList - Set only after the control has been sized correctly.
ShowPivotTableFieldList = true - This prevents the field list UI from rendering in an unusable layout on small controls.
核心特性:
- 类Excel透视表 - 熟悉的数据透视与分析界面
- 交互式架构设计器 - 内置透视表字段列表,支持拖放字段管理
- 多数据源支持 - 兼容IList、IEnumerable、DataTable、DataView、OLAP
- 钻取导航 - 交互式展开/折叠分层数据
- 高级计算 - 求和、平均值、计数、最小值、最大值、自定义表达式、累计总计
- 筛选与排序 - 标签筛选、值筛选、多级排序
- 分组栏 - 可视化字段组织,支持拖放
- 条件格式 - 根据规则和条件设置单元格样式
- 导出能力 - 导出至Excel、PDF、Word并保留格式
- 单元格选择 - 单选、多选、范围选择模式
- 编辑支持 - 修改单元格值并更新聚合结果
- 触控支持 - 适用于平板设备的触控友好交互
- 本地化 - 多语言支持
命名空间:
Syncfusion.Windows.Forms.PivotAnalysis程序集依赖:
Syncfusion.Grid.Windows.dllSyncfusion.PivotAnalysis.Base.dllSyncfusion.PivotAnalysis.Windows.dllSyncfusion.Shared.Base.dll
NuGet使用指南:
- 安装最新版本的Syncfusion.PivotTable.WinForms
- 优先使用NuGet包引用,而非手动添加DLL引用
- 升级前验证包与项目目标框架的兼容性
重要UI设置说明:
- 在WinForms窗体中创建控件时,务必使用
new PivotGridControl(this.components); - 务必先设置和
Location,确保控件尺寸大于300 x 300后,再启用SizeShowPivotTableFieldList - 仅在控件尺寸设置正确后,再将
ShowPivotTableFieldList = true - 此操作可避免字段列表UI在小尺寸控件上呈现为不可用布局
Documentation and Navigation Guide
文档与导航指南
Getting Started
快速入门
📄 Read: references/getting-started.md
- Assembly deployment and required dependencies
- Adding Pivot Grid via Visual Studio designer
- Adding Pivot Grid via code-behind
- License key registration
- Basic control initialization
- Initial configuration and setup
📄 阅读: references/getting-started.md
- 程序集部署与所需依赖
- 通过Visual Studio设计器添加Pivot Grid
- 通过代码后台添加Pivot Grid
- 许可证密钥注册
- 基础控件初始化
- 初始配置与设置
Data Management
数据管理
📄 Read: references/data-binding.md
- Binding to IEnumerable collections (List<T>, ObservableCollection)
- Binding to DataTable and DataView
- Binding to OLAP data sources
- Dynamic data updates and refresh
- Data source requirements and best practices
- Performance optimization for large datasets
📄 阅读: references/data-binding.md
- 绑定至IEnumerable集合(List<T>、ObservableCollection)
- 绑定至DataTable和DataView
- 绑定至OLAP数据源
- 动态数据更新与刷新
- 数据源要求与最佳实践
- 大型数据集的性能优化
Pivot Schema Designer
透视架构设计器
📄 Read: references/pivot-schema-designer.md
- Enabling Pivot Table Field List
- Drag-and-drop field organization
- Field configuration and customization
- Showing/hiding the schema designer
- Programmatic field manipulation
- Custom field templates
📄 阅读: references/pivot-schema-designer.md
- 启用透视表字段列表
- 拖放字段组织
- 字段配置与自定义
- 显示/隐藏架构设计器
- 程序化字段操作
- 自定义字段模板
Rows, Columns, and Summaries
行、列与汇总
📄 Read: references/rows-columns-summaries.md
- Configuring pivot rows (PivotRows collection)
- Configuring pivot columns (PivotColumns collection)
- Summary types (Sum, Average, Count, Min, Max, etc.)
- Custom aggregation functions
- Calculation information and formatting
- Hierarchical structures and nesting
- Total headers and subtotals
📄 阅读: references/rows-columns-summaries.md
- 配置透视行(PivotRows集合)
- 配置透视列(PivotColumns集合)
- 汇总类型(求和、平均值、计数、最小值、最大值等)
- 自定义聚合函数
- 计算信息与格式设置
- 分层结构与嵌套
- 总计表头与小计
Filtering and Sorting
筛选与排序
📄 Read: references/filtering-sorting.md
- Filter types (Label filter, Value filter)
- Interactive filtering with UI
- Programmatic filter configuration
- Filter conditions and predicates
- Sort modes (Ascending, Descending, Custom)
- Multi-level sorting strategies
- Clearing and resetting filters
📄 阅读: references/filtering-sorting.md
- 筛选类型(标签筛选、值筛选)
- 交互式UI筛选
- 程序化筛选配置
- 筛选条件与谓词
- 排序模式(升序、降序、自定义)
- 多级排序策略
- 清除与重置筛选
Grouping and Layouts
分组与布局
📄 Read: references/grouping-layouts.md
- Grouping bar functionality and visibility
- Layout types (Normal, Top summary, No summaries, etc.)
- Drill-down and drill-up navigation
- Expand/collapse behaviors and events
- Custom layout configurations
- Performance optimization for grouped data
📄 阅读: references/grouping-layouts.md
- 分组栏功能与可见性
- 布局类型(普通、顶部汇总、无汇总等)
- 钻取与钻取导航
- 展开/折叠行为与事件
- 自定义布局配置
- 分组数据的性能优化
Calculations and Editing
计算与编辑
📄 Read: references/calculations-editing.md
- Pivot calculations (Difference, % of, Running total, etc.)
- Creating expression fields and custom formulas
- Editing cell values interactively
- Updating aggregated values programmatically
- Validation rules and constraints
- Calculated fields and custom aggregations
📄 阅读: references/calculations-editing.md
- 透视计算(差值、占比、累计总计等)
- 创建表达式字段与自定义公式
- 交互式编辑单元格值
- 程序化更新聚合值
- 验证规则与约束
- 计算字段与自定义聚合
Cell Selection and Formatting
单元格选择与格式设置
📄 Read: references/cell-selection-formatting.md
- Cell selection modes (Single, Range, Multiple)
- Selection events and handling
- Conditional formatting rules and conditions
- Format conditions based on cell values
- Styling cells, rows, and columns
- Custom cell appearance and templates
📄 阅读: references/cell-selection-formatting.md
- 单元格选择模式(单选、范围、多选)
- 选择事件与处理
- 条件格式规则与条件
- 基于单元格值的格式条件
- 单元格、行、列样式设置
- 自定义单元格外观与模板
Data Exploration
数据探索
📄 Read: references/data-exploration.md
- Hyperlink cells for navigation
- Drill-through functionality to view details
- Data visualization techniques
- Interactive navigation patterns
- User interaction events
- Tooltips and cell value display
📄 阅读: references/data-exploration.md
- 用于导航的超链接单元格
- 查看详情的钻取功能
- 数据可视化技巧
- 交互式导航模式
- 用户交互事件
- 工具提示与单元格值显示
Exporting and Printing
导出与打印
📄 Read: references/exporting-printing.md
- Exporting to Excel (XLS, XLSX)
- Exporting to PDF with formatting
- Exporting to Word documents
- Print configuration and preview
- Custom export options and templates
- Handling large exports efficiently
📄 阅读: references/exporting-printing.md
- 导出至Excel(XLS、XLSX)
- 带格式导出至PDF
- 导出至Word文档
- 打印配置与预览
- 自定义导出选项与模板
- 高效处理大型导出任务
Advanced Features
高级特性
📄 Read: references/advanced-features.md
- Asynchronous data processing for large datasets
- Serialization and deserialization of pivot state
- Freezing row/column headers
- Touch support for tablet devices
- Localization and right-to-left (RTL) support
- Custom cell templates and renderers
- Performance tuning and optimization
📄 阅读: references/advanced-features.md
- 大型数据集的异步数据处理
- 透视状态的序列化与反序列化
- 冻结行/列表头
- 平板设备的触控支持
- 本地化与从右到左(RTL)支持
- 自定义单元格模板与渲染器
- 性能调优与优化
Quick Start Example
快速入门示例
Basic Pivot Grid with Data Binding
带数据绑定的基础Pivot Grid
csharp
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Syncfusion.Windows.Forms.PivotAnalysis;
using Syncfusion.PivotAnalysis.Base;
using Syncfusion.Windows.Forms;
namespace PivotGridDemo
{
public partial class MainForm : Form
{
private PivotGridControl pivotGridControl1;
public MainForm()
{
InitializeComponent();
InitializePivotGrid();
}
private void InitializePivotGrid()
{
// Create pivot grid instance using the form components container
pivotGridControl1 = new PivotGridControl(this.components);
// Set size and position first
pivotGridControl1.Location = new System.Drawing.Point(10, 10);
pivotGridControl1.Size = new System.Drawing.Size(800, 500);
pivotGridControl1.Anchor = AnchorStyles.Top | AnchorStyles.Left |
AnchorStyles.Right | AnchorStyles.Bottom;
// Apply visual style
pivotGridControl1.GridVisualStyles = GridVisualStyles.Metro;
// Bind data source
pivotGridControl1.ItemSource = GetSalesData();
// Configure pivot rows
pivotGridControl1.PivotRows.Add(new PivotItem
{
FieldMappingName = "Product",
TotalHeader = "Total"
});
pivotGridControl1.PivotRows.Add(new PivotItem
{
FieldMappingName = "Date",
TotalHeader = "Total"
});
// Configure pivot columns
pivotGridControl1.PivotColumns.Add(new PivotItem
{
FieldMappingName = "Country",
TotalHeader = "Total"
});
// Configure calculations (summary values)
pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo
{
FieldName = "Amount",
Format = "C", // Currency format
SummaryType = SummaryType.DoubleTotalSum
});
pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo
{
FieldName = "Quantity",
Format = "#,##0"
});
// Enable the field list only after the control has been sized correctly
pivotGridControl1.ShowPivotTableFieldList = true;
// Add to form
this.Controls.Add(pivotGridControl1);
}
private List<ProductSales> GetSalesData()
{
// Sample data for demonstration
return new List<ProductSales>
{
new ProductSales
{
Product = "Bike",
Date = "FY 2023",
Country = "United States",
Quantity = 120,
Amount = 24000
},
new ProductSales
{
Product = "Car",
Date = "FY 2023",
Country = "Canada",
Quantity = 45,
Amount = 135000
},
// Add more data...
};
}
}
public class ProductSales
{
public string Product { get; set; }
public string Date { get; set; }
public string Country { get; set; }
public int Quantity { get; set; }
public double Amount { get; set; }
}
}csharp
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Syncfusion.Windows.Forms.PivotAnalysis;
using Syncfusion.PivotAnalysis.Base;
using Syncfusion.Windows.Forms;
namespace PivotGridDemo
{
public partial class MainForm : Form
{
private PivotGridControl pivotGridControl1;
public MainForm()
{
InitializeComponent();
InitializePivotGrid();
}
private void InitializePivotGrid()
{
// 使用窗体组件容器创建透视网格实例
pivotGridControl1 = new PivotGridControl(this.components);
// 先设置尺寸与位置
pivotGridControl1.Location = new System.Drawing.Point(10, 10);
pivotGridControl1.Size = new System.Drawing.Size(800, 500);
pivotGridControl1.Anchor = AnchorStyles.Top | AnchorStyles.Left |
AnchorStyles.Right | AnchorStyles.Bottom;
// 应用视觉样式
pivotGridControl1.GridVisualStyles = GridVisualStyles.Metro;
// 绑定数据源
pivotGridControl1.ItemSource = GetSalesData();
// 配置透视行
pivotGridControl1.PivotRows.Add(new PivotItem
{
FieldMappingName = "Product",
TotalHeader = "Total"
});
pivotGridControl1.PivotRows.Add(new PivotItem
{
FieldMappingName = "Date",
TotalHeader = "Total"
});
// 配置透视列
pivotGridControl1.PivotColumns.Add(new PivotItem
{
FieldMappingName = "Country",
TotalHeader = "Total"
});
// 配置计算(汇总值)
pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo
{
FieldName = "Amount",
Format = "C", // 货币格式
SummaryType = SummaryType.DoubleTotalSum
});
pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo
{
FieldName = "Quantity",
Format = "#,##0"
});
// 仅在控件尺寸设置正确后启用字段列表
pivotGridControl1.ShowPivotTableFieldList = true;
// 添加至窗体
this.Controls.Add(pivotGridControl1);
}
private List<ProductSales> GetSalesData()
{
// 演示用示例数据
return new List<ProductSales>
{
new ProductSales
{
Product = "Bike",
Date = "FY 2023",
Country = "United States",
Quantity = 120,
Amount = 24000
},
new ProductSales
{
Product = "Car",
Date = "FY 2023",
Country = "Canada",
Quantity = 45,
Amount = 135000
},
// 添加更多数据...
};
}
}
public class ProductSales
{
public string Product { get; set; }
public string Date { get; set; }
public string Country { get; set; }
public int Quantity { get; set; }
public double Amount { get; set; }
}
}Common Patterns
常见模式
Pattern 1: Enable Pivot Schema Designer
模式1:启用透视架构设计器
csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// Show the Pivot Table Field List (schema designer)
pivotGridControl1.ShowPivotTableFieldList = true;
// Users can now drag and drop fields to reorganize the pivot structure
// This provides Excel-like field management functionalitycsharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// 显示透视表字段列表(架构设计器)
pivotGridControl1.ShowPivotTableFieldList = true;
// 用户现在可通过拖放字段重新组织透视结构
// 这提供了类Excel的字段管理功能Pattern 2: Apply Conditional Formatting
模式2:应用条件格式
csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// Add conditional formatting rule
PivotCellStyle style = new PivotCellStyle();
style.BackColor = Color.LightCoral;
style.ForeColor = Color.White;
ConditionalFormat condition = new ConditionalFormat();
condition.Conditions.Add(new PivotCondition
{
ConditionType = PivotConditionType.LessThan,
PredicateValue = 10000
});
condition.ApplyStyleInfo = style;
pivotGridControl1.TableControl.ConditionalFormats.Add(condition);csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// 添加条件格式规则
PivotCellStyle style = new PivotCellStyle();
style.BackColor = Color.LightCoral;
style.ForeColor = Color.White;
ConditionalFormat condition = new ConditionalFormat();
condition.Conditions.Add(new PivotCondition
{
ConditionType = PivotConditionType.LessThan,
PredicateValue = 10000
});
condition.ApplyStyleInfo = style;
pivotGridControl1.TableControl.ConditionalFormats.Add(condition);Pattern 3: Export to Excel
模式3:导出至Excel
csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// Export pivot grid to Excel file
pivotGridControl1.ExportToExcel("PivotReport.xlsx");
// Export with options
ExcelExportOptions options = new ExcelExportOptions();
options.ExportMode = ExportMode.Value; // or ExportMode.Text
pivotGridControl1.ExportToExcel("PivotReport.xlsx", options);csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// 将透视网格导出至Excel文件
pivotGridControl1.ExportToExcel("PivotReport.xlsx");
// 带选项导出
ExcelExportOptions options = new ExcelExportOptions();
options.ExportMode = ExportMode.Value; // 或ExportMode.Text
pivotGridControl1.ExportToExcel("PivotReport.xlsx", options);Pattern 4: Handle Drill-Down Events
模式4:处理钻取事件
csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// Subscribe to drill-down event
pivotGridControl1.HyperlinkCellClick += PivotGridControl1_HyperlinkCellClick;
private void PivotGridControl1_HyperlinkCellClick(object sender,
HyperlinkCellClickEventArgs e)
{
// Get the clicked cell information
string cellValue = e.Text;
int rowIndex = e.RowIndex;
int colIndex = e.ColIndex;
// Show drill-through data or navigate to details
// e.Cancel = true; // Cancel default drill behavior if needed
}csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
// 订阅钻取事件
pivotGridControl1.HyperlinkCellClick += PivotGridControl1_HyperlinkCellClick;
private void PivotGridControl1_HyperlinkCellClick(object sender,
HyperlinkCellClickEventArgs e)
{
// 获取点击的单元格信息
string cellValue = e.Text;
int rowIndex = e.RowIndex;
int colIndex = e.ColIndex;
// 显示钻取数据或导航至详情页
// e.Cancel = true; // 如需取消默认钻取行为,请启用此设置
}Pattern 5: Programmatic Filtering
模式5:程序化筛选
csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
using Syncfusion.PivotAnalysis.Base;
// Add filter to a specific field
PivotItem productRow = pivotGridControl1.PivotRows[0];
productRow.FilterItems = new List<string> { "Bike", "Car" };
// Or use filter expressions
FilterExpression filter = new FilterExpression();
filter.FieldName = "Product";
filter.FilterItems.Add("Bike");
filter.FilterItems.Add("Car");
pivotGridControl1.Filters.Add(filter);
// Refresh the pivot grid to apply filters
pivotGridControl1.TableControl.Refresh();csharp
using Syncfusion.Windows.Forms.PivotAnalysis;
using Syncfusion.PivotAnalysis.Base;
// 为特定字段添加筛选
PivotItem productRow = pivotGridControl1.PivotRows[0];
productRow.FilterItems = new List<string> { "Bike", "Car" };
// 或使用筛选表达式
FilterExpression filter = new FilterExpression();
filter.FieldName = "Product";
filter.FilterItems.Add("Bike");
filter.FilterItems.Add("Car");
pivotGridControl1.Filters.Add(filter);
// 刷新透视网格以应用筛选
pivotGridControl1.TableControl.Refresh();Pattern 6: Custom Aggregation
模式6:自定义聚合
csharp
using Syncfusion.PivotAnalysis.Base;
// Create custom calculation with expression
PivotComputationInfo customCalc = new PivotComputationInfo
{
FieldName = "Profit",
CalculationType = CalculationType.Custom,
Format = "C",
SummaryType = SummaryType.Custom
};
// Define custom summary calculation
customCalc.CustomSummaryMethod = (items) =>
{
double total = 0;
foreach (var item in items)
{
total += (double)item.GetType().GetProperty("Amount").GetValue(item, null);
}
return total * 0.15; // Calculate 15% profit margin
};
pivotGridControl1.PivotCalculations.Add(customCalc);csharp
using Syncfusion.PivotAnalysis.Base;
// 使用表达式创建自定义计算
PivotComputationInfo customCalc = new PivotComputationInfo
{
FieldName = "Profit",
CalculationType = CalculationType.Custom,
Format = "C",
SummaryType = SummaryType.Custom
};
// 定义自定义汇总计算
customCalc.CustomSummaryMethod = (items) =>
{
double total = 0;
foreach (var item in items)
{
total += (double)item.GetType().GetProperty("Amount").GetValue(item, null);
}
return total * 0.15; // 计算15%的利润率
};
pivotGridControl1.PivotCalculations.Add(customCalc);Common Use Cases
常见用例
-
Sales Analysis Dashboard
- Track sales by product, region, and time period
- Compare performance across multiple dimensions
- Identify trends and patterns in sales data
-
Financial Reporting
- Budget vs. actual analysis
- Expense tracking and categorization
- Revenue breakdown by department/product
-
Inventory Management
- Stock levels by location and product category
- Movement analysis and turnover rates
- Reorder point calculations
-
Business Intelligence
- KPI dashboards with drill-down capabilities
- Cross-functional data analysis
- Executive summary reports
-
Customer Analytics
- Customer segmentation and profiling
- Purchase pattern analysis
- Retention and churn metrics
-
Operational Reports
- Production efficiency tracking
- Resource utilization analysis
- Quality metrics and defect tracking
-
销售分析仪表板
- 按产品、地区和时间段跟踪销售情况
- 跨多个维度对比绩效
- 识别销售数据中的趋势与模式
-
财务报告
- 预算与实际情况分析
- 费用跟踪与分类
- 按部门/产品划分的收入明细明细
-
库存管理
- 按位置和产品类别查看库存水平
- 库存周转分析与周转率
- 补货点计算
-
商业智能
- 具备钻取能力的KPI仪表板
- 跨职能数据分析
- 高管摘要报告
-
客户分析
- 客户细分与画像
- 购买模式分析
- 留存率与流失率指标
-
运营报告
- 生产效率跟踪
- 资源利用率分析
- 质量指标与缺陷跟踪
Key Props and Configuration
核心属性与配置
Essential Properties:
- - Data source for the pivot grid (IEnumerable, DataTable, etc.)
ItemSource - - Collection of fields displayed as row headers
PivotRows - - Collection of fields displayed as column headers
PivotColumns - - Summary calculations (Sum, Average, Count, etc.)
PivotCalculations - - Enable/disable the schema designer
ShowPivotTableFieldList - - Apply visual themes (Metro, Office2016, etc.)
GridVisualStyles
Customization Properties:
- - Allow users to expand/collapse grouped data
EnableDrillDown - - Display grand total rows and columns
ShowGrandTotals - - Display subtotal rows and columns
ShowSubTotals - - Enable cell selection
AllowSelection - - Enable filtering UI
AllowFiltering - - Enable sorting functionality
AllowSorting
Refer to the reference files above for detailed documentation on all properties, methods, and events.
必备属性:
- - 透视网格的数据源(IEnumerable、DataTable等)
ItemSource - - 显示为行标题的字段集合
PivotRows - - 显示为列标题的字段集合
PivotColumns - - 汇总计算(求和、平均值、计数等)
PivotCalculations - - 启用/禁用架构设计器
ShowPivotTableFieldList - - 应用视觉主题(Metro、Office2016等)
GridVisualStyles
自定义属性:
- - 允许用户展开/折叠分组数据
EnableDrillDown - - 显示总计行与列
ShowGrandTotals - - 显示小计行与列
ShowSubTotals - - 启用单元格选择
AllowSelection - - 启用筛选UI
AllowFiltering - - 启用排序功能
AllowSorting
有关所有属性、方法和事件的详细文档,请参阅上述参考文件。