This program does not need to modify the control source code, is the perfect solution to support multi-column fuzzy matching fast input the best solution!!
1. Set the Properties property of the column to Extlookupcombobox.
Properties.incrementalfiltering: = False;
Properties.casesensitivesearch: = False;
Properties.dropdownliststyle: = lseditlist;
Of course, you will then complete the setup of Properties.view,properties.keyfieldnames and Properties.listfielditem.
The column of this case is: cxgriddbtableview1vendor_id:tcxgriddbcolumn; The binding service ID is automatic.
2. Properties.onchange Event code:
Procedure Tformcxlookupcombox.cxgriddbtableview1vendor_idpropertieschange (Sender:tobject);
Var
Icol:integer;
vinputtext:string;
Begin
Note: cxgriddbtableview1vendor_id:tcxgriddbcolumn;
(Sender as Tcxextlookupcombobox). Properties.incrementalsearch: = False; Necessary
(Sender as Tcxextlookupcombobox). Properties.caseinsensitive: = True; Necessary
(Sender as Tcxextlookupcombobox). Properties.incrementalfiltering: = false;//design period is set in properties.
(Sender as Tcxextlookupcombobox). Properties.casesensitivesearch: = False; The design period is set in the properties.
(Sender as Tcxextlookupcombobox). Properties.dropdownliststyle: = lseditlist;//Design period set in properties
Vinputtext: = (Sender as Tcxextlookupcombobox). EditText;
With (cxgrid1dbtableview1vendor_id. Properties as Tcxextlookupcomboboxproperties) do
With (Sender as Tcxextlookupcombobox). Properties do//change to generic notation.
Begin
View.DataController.Filter.Options: = [fcocaseinsensitive];
View.DataController.Filter.Clear;
View.DataController.Filter.Root.Clear;
All visual columns in the view are used for fuzzy retrieval.
For icol: = 0 to View.visibleitemcount-1 do
Begin
If icol > 0 then View.DataController.Filter.Root.BoolOperatorKind: = Fboor;
View.DataController.Filter.Root.AddItem (View.visibleitems[icol], folike,
'% ' + vinputtext + '% ', '% ' + vinputtext + '% ');
End
View.DataController.Filter.Active: = True;
End
End
3. Properties.oncloseup Event code:
Procedure Tformcxlookupcombox.cxgriddbtableview1vendor_idpropertiescloseup (Sender:tobject);
Begin
(Sender as Tcxextlookupcombobox). Properties.View.DataController.Filter.Clear;
End
If you do not edit the data in the column of Cxgrid, you can use the Tcxdbextlookupcombobox control to implement the same method as above!
Transferred from: http://blog.csdn.net/qq56430204/article/details/52199007
DevExpress control Textlookupcombobox Method of implementing multi-column fuzzy matching input