users cxDBFilterControl,cxFilterControlUtils,Variants;
type TmyDBFilterControl = class(TcxDBFilterControl) end;
//以下这段代码是写在哪个事件里呢?
with TmyDBFilterControl(FilterCtrl) do
for i := 0 to RowCount - 1 do
if (i > 0) and (Rows[i].Condition.&Operator in [fcoLike, fcoNotLike]) then
with Rows[i].Condition do
for j := 0 to Values.Count - 1 do
with Values.Values[j] do begin
if Pos('%', ValueText) = 0 then ValueText := '%' + ValueText + '%';
if Pos('%', VarToStr(Value)) = 0 then Value := '%' + VarToStr(Value) + '%';
end;
放在TcxDBFilterControl组件中的OnApplyFilter事件中,当用户设定好条件点击确定后,按着你的要求对每一个条件进行检测。帮其加上%