TDBGrid状态栏用于列聚合 [英] TDBGrid status bar for column aggregate
问题描述
得到了一个包含一些数字列的网格,并且需要为每个列实现汇总(总和或计数)并将其显示在相应的列下.
Got a grid with some numeric columns and it's need to implement for each column an aggregate (sum or count) and display it under the corresponding column.
我知道某些套件(DevExpress或其他套件)已经默认"实现.但是有一种方法可以使用默认控件或JVCL来实现?
I know that some suites (DevExpress or other) had already implemented "by default". But there is a way to implement that using default controls or JVCL?
推荐答案
自从您提到 JEDI VCL
,请尝试查看 TJvDBGridFooter
组件.它是 TJvDBGrid
控件的状态栏.
Since you have mentioned JEDI VCL
, try to take a look at the TJvDBGridFooter
component. It is the status bar for the TJvDBGrid
control.
- 您可以在
OnDisplayText
中修改显示的文本事件 - 您可以在
OnCalculate
中计算聚合字段事件 - 您可以跟随网格列滚动,调整面板大小或修改面板的外观
- you can modify the displayed text in the
OnDisplayText
event - you can calculate the aggregate fields in the
OnCalculate
event - you can follow the grid column scroll, resize or modify the appearence of the panels
从JVCL的 .. \ examples \ JvUltimDBGrid
文件夹中检查演示项目,以查看其运行情况.
Check the demo projects from JVCL's ..\examples\JvUltimDBGrid
folder to see it in action.
这篇关于TDBGrid状态栏用于列聚合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!