C1FlexGrid 学习(1) - 博客文库 - 博客园

本文介绍了如何使用C1FlexGrid的Subtotal方法来计算数据的子总计,包括Sum求和操作,并展示了如何设置分组层次、列依据和分组标题。示例代码详细解释了各个参数的含义,帮助理解C1FlexGrid的子总计功能。
摘要由CSDN通过智能技术生成

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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值