使用 Developer Express 中的 QuantumGrid (TcxGrid) 记录用户界面

发布于 2024-08-15 03:23:09 字数 403 浏览 9 评论 0原文

我需要生成一个用于输入销售文档(例如发票)的用户界面。我正在尝试使用“开发人员表达”的组件,特别是 QuantumGrid 组件(TcxGrid)。我在 devexpress 支持中心看过主从组件和搜索的演示,但没有一个对我有帮助,因为它们都使用 2 个网格来处理主从关系,并一次编辑多个记录。

我只需要一次编辑一条记录(文档),并在标题中使用一对对象数据件组件(例如 TDBEdit)和一个网格来处理细节。

像这样的

“替代文本”

在哪里可以找到以这种方式使用这些组件的基本示例?

I need to generate a user interface for entering a sales document (eg invoice). I'm trying to use components of "developer express" specifically the QuantumGrid component (TcxGrid). I've seen the demos of master-detail components and search in the devexpress support center, but none has helped me because all use 2 grids to handle the master-detail relation, and edit multiple records at once.

I just need to edit a record (document) at a time and using a pair of objects dataware components (eg TDBEdit) in the header and a grid to handle the detail.

something like this

alt text

Where can I find a basic example of using these components in this way?

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

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

发布评论

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

评论(4

温馨耳语 2024-08-22 03:23:09

QuantumGrid 中的主/子属性主要设计用于在网格中嵌套多个项目。如果您在数据组件中设置关系,您可以简单地将控件连接到正确的数据源,一切都会正常工作。

因此,如果您有两个数据集“客户”和“发票”。发票主数据源是客户数据源。然后,在编辑控件上,您指向客户数据源,并将网格指向发票数据源。

如果您考虑主/详细关系的作用,它实际上只是过滤详细数据集中的记录以匹配主数据集中的当前记录。各个编辑控件将始终显示它们所连接的数据集中的“当前”记录。网格将显示它们连接到的数据集中的所有可见记录。

我倾向于不在编辑表单中使用主/详细信息关系,就像您在此处所示的那样。我假设在不同的屏幕上有某种方法可以选择要编辑的发票。我通常会创建所需数据集的副本,其中仅包含此编辑所需的记录。如果我正在编辑现有发票,我会复制当前记录。如果是新发票,我可以从空记录集开始。这是更多的工作 - 我有一些通用库函数,它们将复制数据集结构,然后将一条或多条记录复制到该数据集中。根据您的设置,您还可以重新查询数据库以获取您感兴趣的记录。显然,不应在所有情况下都这样做。这种方法的另一个问题是您需要一种方法来更新您可能拥有的任何其他数据集(即您的主搜索屏幕)。

然而,一旦我进入编辑屏幕,我发现它让事情变得更容易。现在我不需要担心顶层的主从关系。如果发票具有内部主/详细信息关系,您可以只处理这些关系,但您知道数据集仅包含这张发票的数据 - 而不是数据库中的所有数据。

对于您的表单,如果您限制数据集中的数据,您可以直接连接所有内容,它应该按您的预期工作。客户数据集中只有一条记录,发票也只有该发票的记录。

Tthe Master/Child properties in the QuantumGrid are mainly designed to nest multiple items in the grid. If you setup the relationship in the data components you can simply hook the controls up to the correct DataSource and everything will work.

So if you have two DataSets Customer and Invoice. The Invoice Master Datasource is the Customer DataSource. Then on your edit controls you point to the Customer DataSource and you point the Grid to the Invoice DataSource.

If you think about what the Master/Detail relationship is doing it really just filters the records on the Detail DataSet to match the current record on the Master DataSet. Individual Edit controls will always display the "current" record in the DataSet they are connected to. Grids will show all visible records in the DataSet they are connected to.

I have a tendency to not use Master/Detail relationships in an edit form like you show here. I'm assuming there is some way on a different screen to pick the invoice to edit. I usually create a copy of the needed DataSets with only the records needed for this edit. If I am editing a existing invoice I copy the current records. If it is a new invoice I can start off with an empty recordset. It is more work - I have some generic library functions that will copy a DataSet Structure and then copy one or more records into that Dataset. Depending on your setup you can also requery your Database to just get the records you are interested in. Obviously that should not be done in all cases. Another issue with this approach is you need a way to update any other Datasets you may have with this data - i.e. your main search screen.

However, once I get on the edit screen I find it makes things eaiser. Now I don't need to worry about the master detail relationship at the top level. If the invoice has internal Master/Detail relationships you can just deal with those, but you know that the DataSets only have the data for this one invoice - not everything in the Database.

In the case of your form if you limit the Data in the DataSets you can just hook everything up directly and it should work as you expect. You would only have one record in the Customer DataSet and the invoice would just have the records for this Invoice.

小鸟爱天空丶 2024-08-22 03:23:09

我认为您需要处理 ClientDataSource 组件中的主从关系。然后网格将遵循这种关系。

I think you'll need to take care of the master-detail relations in your ClientDataSource components. The grid will then follow this relation.

來不及說愛妳 2024-08-22 03:23:09

您为什么不在 [email protected] 询问此问题?

我订阅 vcl 的原因当然除了组件的质量之外,还因为他们确实有很好的支持网站和员工?

在那里,您可以直接向编写这些内容的人询问,他们很可能很乐意为您提供示例程序(至少多年来我收到了很多示例)。

Why don't you ask this at [email protected] ?

The reason why I have a vcl subscription is, apart from the quality of the components of course, because they do have a great support site and staff ?

There you ask it directly to the people who have written the stuff, and they are most likely happy to supply you with a sample program (at least I have received a lot of samples over the years).

前事休说 2024-08-22 03:23:09

前提与任何其他主从关系相同,无论组件如何。您将需要在数据集级别设置主从信息才能完成您想要的任务。

The premise is the same as with any other master-detail relationship, regardless of the components. You will need to setup the master-detail on the dataset level to accomplish what you want.

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