如何在同一个窗体上显示两个不同数据的网格

发布于 2024-12-17 10:48:23 字数 391 浏览 1 评论 0原文

我有一个带有两个网格的表格。我有一个包含行的表,其中每行的状态为“是”或“否”。我想在顶部网格中显示所有“是”,在底部网格中显示“否”。

如果我想显示 SalesTable 标头记录,则会出现类似的情况。顶部网格仅包含状态为“已交付”的网格,底部网格仅包含状态为“已开票”的网格。

我怎样才能做到这一点?

通过添加相同表类型的另一个数据源,我已经接近了。我添加了一个 QueryBuildRange 来过滤记录,但遇到两个问题:

  1. 当我单击顶部/底部的一行时,它会同时移动两条行线(突出显示的内容是
  2. 它希望显示与顶部行数相同的行)由于某种原因,底部行??如果我有 3 个已交付的销售订单和 5 个已开具发票的销售订单,则会在顶部显示 3 个,在底部显示 3 个。

I have a form with two grids. I have one table with rows where each row has a status of Yes or No. I'd like to display all the yes's in the top and the no's in the bottom grid.

A similar scenario would be if I wanted to show SalesTable header records. The top grid would be only those with a status of Delivered, and the bottom grid those with a status of Invoiced.

How can I accomplish this?

I've gotten close by adding another datasource of the same table type. I add a QueryBuildRange to filter the records but I get two issues:

  1. When I click on a row in the top/bottom, it moves both row lines at the same time (the highlighting thing
  2. It wants to show an equal number of top rows as bottom rows for some reason?? If I have 3 delivered sales orders, and 5 invoiced sales orders, it will show 3 in the top and 3 in the bottom.

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

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

发布评论

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

评论(1

凉城已无爱 2024-12-24 10:48:23

像网格控件这样的接缝由相同的数据源控制。
检查网格控件的属性:确保它们没有设置为相同的数据源!

无论如何,了解 Form 的结构以及 QueryBuildRange 的添加方式将会很有帮助。

我创建了一个非常简单的表单,它工作正常:

  • 添加了两个带有 T-SalesTable 的数据集,每个数据集
  • 添加了两个网格控件到设计(或 TabPage,两者都有效)
  • 调整每个网格的数据源属性以指向每个数据源
  • 将字段(自动报告组)从相应的数据源添加到每个网格,

这个工作正常(尽管具有相同的内容)。然后我

  • 在每个数据集的 init 方法中添加了一个范围

,它仍然有效。

在此处输入图像描述

Seams like the Grid-controls are being controlled by the same DataSource.
Check the properties of the Grid-control: make sure they are not set to the same DataSource!

Anyway, it would be helpful to know how the Form is structured and how the QueryBuildRange was added.

I created a very simple Form and it worked correctly:

  • added two Datasets with T-SalesTable each
  • added two Grid-controls to the Design (or to a TabPage, both worked)
  • adjusted the DataSource-property of each Grid to point to each DataSource
  • added fields (the AutoReport group) from the corresponding DataSource to each Grid

this one worked correctly (despite having the same contents. Then I

  • added a range in the init method of each of the Datasets

and it still worked.

enter image description here

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