可以从数据集外部完成数据集过滤吗? [英] Can Dataset filtering be done from outside the dataset?

查看:184
本文介绍了可以从数据集外部完成数据集过滤吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个TDBLookupComboBox控件,我想连接到同一个数据集,但每个显示不同的数据子集。如果我只需要一个框,我会在数据集上使用过滤,但是我需要同时显示它们,我不知道有什么办法。有人知道是否可以完成,如果是这样,怎么样?

I have two TDBLookupComboBox controls that I'd like to connect to the same dataset, but have each one display a different subset of the data. If I only needed one box, I'd use filtering on the dataset, but I need to be able to display both of them at the same time, and I'm not aware of any way to do that. Does anyone know if it can be done, and if so, how?

推荐答案

如果你使用TClientDataSet,你可以将游标(TClientDataSet.CloneCursor)克隆到另一个没有设置ProviderName属性的TClientDataSet中。 ClientDataSet现在指向内存中的相同数据,但可以有自己的过滤器。

If you're using a TClientDataSet, you can clone the cursor (TClientDataSet.CloneCursor) into another TClientDataSet that doesn't have the ProviderName property set. Both ClientDataSet now point to the same data in memory but can have their own filters.

这篇关于可以从数据集外部完成数据集过滤吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆