如何创建带有复合列的 dbgrid?

发布于 2024-08-28 22:43:06 字数 65 浏览 9 评论 0原文

我如何创建带有复合列的 dbgrid,

例如:dbgrid header |名称 | |第一|最后|

how can i create dbgrid with composite columns,

example :dbgrid header
| name |
| first | last |

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南烟 2024-09-04 22:43:06

合成应该/必须在数据集(表)上完成。
如果您使用 SQL Selects 来获取数据,则应在 select 语句中进行“组合”(语法取决于数据引擎/sql 服务器)。
您还可以在数据集上创建一个计算字段(查看帮助和使用 delphi 安装的示例)。

The composition should/has to be done on the dataset (table).
If you use a SQL Selects for getting your data, you shoud make the "composition" in the select statement (syntax depends of the data engine/sql server).
You can also make a calculated field on the datasset (look in help and in the examples installed with delphi.

疏忽 2024-09-04 22:43:06

您可以通过编码获得此类功能:

  1. 子类化 DBGrid
  2. Virtual TreeView 您编写数据库访问内容(网站上有示例),并管理自定义绘图

或通过付费:

  1. DevExpress 是我的选择,令人惊叹的网格。
  2. 任何其他第三方网格,如提到的 EHLib...

You can get such functionality by coding:

  1. Subclassing a DBGrid
  2. Virtual TreeView you write the DB access stuff (there are examples on the site), and manage the custom drawing

Or by paying:

  1. DevExpress is my choice, amazing grids.
  2. Any other third party grid like the one mentioned EHLib...
花期渐远 2024-09-04 22:43:06

标准 Delphi DBGrid 不支持此类功能,但聚合字段类型除外,该类型仅在 ClientDataset 中受支持。

您可以使用提供此类功能的第 3 方网格组件。我个人喜欢 EhLib 网格,它提供了此功能以及许多其他功能。以下是带有嵌套列标题的 EhLib 的屏幕截图:

替代文本
(来源:ehlib.com

您可以查看其他截图在这个链接中:
http://www.ehlib.com/dbgrideh1.htm

Standard Delphi DBGrid does not support such feature except for Aggregate field type which is supported only in ClientDataset.

You can use 3rd-party grid components that provide such functionality. I personally like EhLib grid which provides this feature, and lots of other ones. Here is a screenshot of EhLib with nested column headers:

alt text
(source: ehlib.com)

You can see other screenshots in this link:
http://www.ehlib.com/dbgrideh1.htm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文