DevExpress control Textlookupcombobox Method of implementing multi-column fuzzy matching input

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.