DevExpress GridControl SummaryItem的Custom Summary

2024-04-01 16:18

本文主要是介绍DevExpress GridControl SummaryItem的Custom Summary,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

转自:http://blog.vsharing.com/janezhangxy/A1453525.html


使用DevExpress GridControl 时,有一栏为colSelected(FieldName 为"Selected") ,需根据此栏是否选中来计算另外一栏colCurrentApplyQuantity(FieldName 为"CurrentApplyQuantity")的Summary.
      依据默认的SummaryItem是无法实现的,需要使用Custom Aggregate Functions. 具体处理过程如下:
      1.设置Gridview OptionsView ShowFooter 为True,用来显示最终的Summary。
      2.设置colCurrentApplyQuantity 的SummaryType为Custome ,Tag 为1.Tag是用来区分SummaryItem.如需要格式化显示的结果,可设置相应的DisplayFormat.
     3.使用gridView1_CustomSummaryCalculate事件来实现依据colSelected来colCurrentApplyQuantity的Summary。 求和包括3个阶段,Initialization, Calculation 和Finalization。依据 CustomSummaryEventArgs.SummaryProcess的值来决定当前进行的那个阶段。具体实现如下:
        int customSum;private void gridView1_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e){int summaryID = Convert.ToInt32((e.Item as GridSummaryItem).Tag);GridView gridView = sender as GridView;      // Initialization if (e.SummaryProcess == CustomSummaryProcess.Start){customSum = 0;}// Calculation if (e.SummaryProcess == CustomSummaryProcess.Calculate){bool isSelected = (bool)gridView.GetRowCellValue(e.RowHandle, "Selected");switch (summaryID){case 1: // The total summary calculated against the 'CurrentApplyQuantity' column. if (isSelected) customSum += Convert.ToInt32(e.FieldValue);                      break;              }}// Finalization if (e.SummaryProcess == CustomSummaryProcess.Finalize){switch (summaryID){case 1:e.TotalValue = customSum;break;}}      }

这篇关于DevExpress GridControl SummaryItem的Custom Summary的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/867602

相关文章

DevExpress WinForms v24.1新版亮点:功能区、数据编辑器全新升级

DevExpress WinForms拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任! DevExpress WinForms控件2024年第一个重大版本——v24.1全新发布,此版本对功能区、状态栏

OEM Activity Summary AAS 不记录后台进程 比如 rman

OEM中rman 备份认为是后台进程,所以在Activity Summary未显示 ,AAS 可以显示 去掉后台进程rman 一个也不显示!

界面控件DevExpress中文教程:如何使用AI扩展Excel计算?

DevExpress WinForms拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任! 获取DevExpress v24.1正式版下载 概述 标准Excel公式处理各种业务需求,当然有时您的企业可

OpenAI Gym custom environment: Discrete observation space with real values

题意:OpenAI Gym 自定义环境:具有实数值的离散观测空间 问题背景: I would like to create custom openai gym environment that has discrete state space, but with float values. To be more precise, it should be a range of valu

安装jmeter的梯度压测线程组(Custom Thread Groups)的插件

1、打开:Install :: JMeter-Plugins.org 2、进入主页后点击下面图片的链接进行安装 3、将安装包放入apache-jmeter-5.4.1    >   lib       >    ext  里面 4、打开Jmeter 点击下面的【Plugins Manager】 5、进入 【Plugins Manager】后选择【Avaliable Plug

记录使用DevExpress的过程遇到问题

vs 2022 版本 DevExpress 版本 24.1 先参考这个网站去下载DevExpress和PatchDevExpress 24.1 版本使用 barManager1 使用过程: 1.菜单栏 默认经典样式 : 1.1 添加下拉菜单: 按照自己的需求去添加 如果有选择 barCheckItem1 复选框的控件下 想改成单选框 需要在checkstyle 选择Radio 同时

关于el-table的show-summary,合计栏不显示以及保留两位小数问题

<el-tableref="table1"v-loading="loading":data="":stripe="true"height="600"show-summary:summary-method="getSummaries":show-overflow-tooltip="true">...</el-table> 合计部分不显示的问题 updated() {this.$nextTi

Photoshop - summary

Photoshop 移动图层 Ctrl + ]:将当前图层移到最顶层;  Ctrl + [:将当前图层移到最底层; Ctrl + Shift + ]:将当前图层上移一层; Ctrl + Shift + [:将当前图层下移一层。

为什么AVL fire DVI 界面里面的response Editor project 中的Summary result 点不了???

🏆本文收录于《CSDN问答解惑-专业版》专栏,主要记录项目实战过程中的Bug之前因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家关注&&收藏&&订阅!持续更新中,up!up!up!! 问题描述   为什么AVL fire DVI 界面里面的response Editor project 中的Summary result 点不了??

SVN安装过程出现“Custom action InstallWMISchemaExecute failed:服务不存在,或已被标记为删除”

在安装SVN服务端的时候,总是出现下面的错误,进而停止安装。具体的错误如下:                            安装了好多的版本,都出现了这样的问题。我的系统是window7 64位的。      哪位路过的大神给评论一下,给点建议。帮我解决一下!在此谢谢啦!