当前位置:主页>销售管理软件> 列表

TcxDBFiltercontroller 找汽车配件进销存

库存管理软件版1楼: Tcxdbfiltercontroller组合条件语句后,从filtertext中怎么分解出各个条件分句?

2楼: 這是Developer Express中哪個套件里的??For D6還是For D7?
我想down下來試試看。 如电脑销售管理软件

3楼: 没有人这样用过?

4楼: 在 FilterCaptio中

5楼: 少打了个 ‘n’, 是在 FFilterControl.FilterCaption中,是个字符串

6楼: to tony1203
filtercaption我知道,我要的不是这个,我想要的是
比如filtertext=(日期>=''2005-12-1'') and (日期<=''2005-12-31'') and (name like ''%A'')
我想要分解出各个条件来
1、(日期>=''2005-12-1'')
2、(日期<=''2005-12-31'')
3、(name like ''%A'')
这样三个分条件

库存管理软件版7楼: 去掉 and?
这个不就是分析字符串了吗?
跟是不是TcxDBFiltercontroller就没有什么关系了吧[?]

8楼: 我是想是不是他本身就有这个功能,如果条件比较复杂时,自已分析可能有误,如果他本身有这个功能应该分析的比较好!

9楼: 里面有个属性专门用来放条件的,每个条件一条记录,我记不得名称了,你遍历这个列表就可以得到你想要的了.

10楼: to dejoy:


我找不到这个属性,能否帮我找找,谢谢!

11楼: TcxCustomFilterControl.Criteria

给你贴一段自带的帮助
Defines the filter criteria of a filter control.

property Criteria: TcxFilterControlCriteria;

Description
The Criteria property is used internally to determine the filter criteria defined by a filter control.

For the TcxFilterControl object, which is destined to operate with any IcxFilterControl-supported objects (typically, grid table views), the Criteria property is of great importance. When applying filtering with the help of the ApplyFilter method, the value of the Criteria property is assigned to the Criteria property of the object linked to the filter control via the LinkComponent property. As a result, the filter conditions defined in a filter control are automatically applied to data of the linked object. Also, when calling the UpdateFilter method, the Criteria property value is updated ?it takes the value of the linked object抯 Criteria property.

As for the TcxDBFilterControl object, the Criteria property represents an implementation of the Criteria property declared by the IcxFilterControl interface. The TcxDBFilterControl object is forced to support this interface itself, since a dataset object to which a data bound filter control is linked via the DataSet property does not provide native means for this purpose.

12楼: 关键是这个东西TcxFilterCriteria
Represents the base class for grid filtering facilities.

Unit
cxFilter

TcxFilterCriteria = class(TPersistent);

Description
The TcxFilterCriteria class is an abstract class which provides the base filtering facilities for a grid control. Filter criteria for a grid control can consist of several filter conditions combined by logical operators (and, or). In turn, a filter condition can represent either a simple comparison operation or an aggregate condition consisting of other simple (or aggregate) conditions combined by logical operators. Thus, you can build complex filter criteria to filter data. The following condition illustrates a complex filter:

(CustNo > 12) AND (LastOrder = ?2/31/2000?OR LastOrder = ?2/31/2001?
There are three filter items:

1. CustNo > 12

2. LastOrder = ?2/31/2000?

3. LastOrder = ?2/31/2001?

To represent such a condition, two lists are used. The first list stores simple conditions 2 and 3. These conditions are combined by the OR operator. The second list is the root one. It points to the simple condition 1 and the condition defined by the first list. Conditions in the second list are combined by the AND operator.


Use the Root property to access the root list of filter conditions for the TcxFilterCriteria object. A list of filter conditions is represented by the TcxFilterCriteriaItemList class. A simple condition is implemented by the TcxFilterCriteriaItem object.

The TcxDataFilterCriteria class is an immediate descendant of the TcxFilterCriteria class. It introduces new properties, methods and events which extend the filtering capabilities. 如汽车配件进销存

13楼: 再贴一段如何自己添加条件的例子:
The following example demonstrates how to set filter criteria for the following string:
(CustNo < 1000) AND ((Name LIKE ''A%'' OR (Name LIKE ''Z%''
)).

The DBTableView1CustNo and DBTableView1Name objects are of the TcxGridDBColumn class. They identify the desired items in a grid control.
To prevent filter criteria from being updated every time a filter condition is added, operations are enclosed within the TcxFilterCriteria.BeginUpdate and TcxFilterCriteria.EndUpdate methods.

//Delphi
var
AItemList: TcxFilterCriteriaItemList;
//...
FDataController.Filter.BeginUpdate;
try
FDataController.Filter.Root.Clear;
FDataController.Filter.Root.AddItem(DBTableView1CustNo,
foLess, 1000, ''1000'');
AItemList := FDataController.Filter.Root.AddItemList(fboOr);
AItemList.AddItem(DBTableView1Name, foLike, ''A%'', ''A%'');
AItemList.AddItem(DBTableView1Name, foLike, ''Z%'', ''Z%'');

finally
FDataController.Filter.EndUpdate;
end;

库存管理软件版14楼: to dejoy
上面列出的是针对tcxdbgrid的,我想要的是Tcxdbfiltercontroler,这个是自定义条件的,不和tcxdbgrid连接的,我只是为了组合条件,取得条件值,但是有时又不得不分解出各个条件,能否给个用tcxdbfiltercontroller的例子?谢谢!

15楼: 帮顶!

http://www.source520.com

站长开发推广同盟 站长朋友的终极驿站
同时拥有海量源码电子经典书籍下载

http://www.source520.com/search/search.asp

"编程.站长"论坛搜索引擎-----为中国站长注入动力!

16楼: 结贴发分,还是自已分析字符串了,用了TcxFilterCriteriaItemList老是出问题。