Public Sub Subtotal(ByVal aggType As C1.Win.C1FlexGrid.AggregateEnum, ByVal level As Integer, ByVal groupOn As Integer, ByVal totalOn As Integer, ByVal caption As String)
.Subtotal()
整了两个小时才搞清楚C1FlexGrid.Subtotal(AggregateEnum.Sum, 0, 1, c, "Grand Total");各个参数的意思。
AggregateEnum.Sum : 对C1FlexGrid里面的数据求和。
0 : 对C1FlexGrid数据分组的第0层。
1: 是根据第 1 列数据进行分组
Grand Total: 第0层分组的头标题
using System;
using System.Drawing;
using System.Drawing.Printing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using C1.Win.C1FlexGrid;
namespace Subtotals
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private C1.Win.C1FlexGrid.C1FlexGrid _flex;
private System.Windows.Forms.CheckBox _chkAbove;
private System.Windows.Forms.CheckBox _chkGrand;
private System.Windows.Forms.CheckBox _chkDirection;
private System.Windows.Forms.CheckBox _chkRegion;
private System.Windows.Forms.Button _btnPrint;
private CheckBox checkBox1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceMa