zoukankan      html  css  js  c++  java
  • dev GridView 的组计和分组计

    /// <summary>
            /// //添加组计
            /// </summary>
            private void SetGroupSummary(GridView gv, string fieldName, GridColumn showInColumn, string displayFormat)
            {
                gv.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, fieldName, showInColumn, displayFormat);//添加组计
            }
            /// <summary>
            /// 分组合计
            /// </summary>
            private void SetGridGroup(GridView gv, string fieldName, string displayFormat, bool isCount = true)
            {
                GridGroupSummaryItem item = new GridGroupSummaryItem();
                item.FieldName = fieldName;
                item.DisplayFormat = displayFormat;
                if (isCount)
                    item.SummaryType = DevExpress.Data.SummaryItemType.Count;
                else
                    item.SummaryType = DevExpress.Data.SummaryItemType.Sum;
                gv.GroupSummary.Add(item);
            }

    调用

    SetGridGroup(gridView2, "names", "总计:{0}");
                SetGridGroup(gridView2, "iitem", "问题件合计:{0}", false);
                SetGroupSummary(gridView2, "iitem", gridColumn6, "组计:{0}");//添加组计
  • 相关阅读:
    SDN第二次作业
    SDN第一次上机作业
    SDN第一次作业
    alpha冲刺第四天
    alpha冲刺第二天
    alpha冲刺第一天
    项目需求分析
    结对第二次作业
    团队选题报告(i know)
    结对作业——原型设计
  • 原文地址:https://www.cnblogs.com/shuaimeng/p/10249382.html
Copyright © 2011-2022 走看看