C # Gridcontrol's fuzzy query implementation code example

Source: Internet
Author: User
This article mainly introduces the C # gridcontrol fuzzy query Implementation code, the need for friends can refer to the following

As shown, if the query vendor name includes a mechanical company, the normal setting is not possible and can only be filtered from the beginning:


Method 1:

The following is the network name for the [not small width] of the user sent me the perfect solution, I posted here, we can learn together:

<summary>///    set Girid for each column fuzzy search///</summary>//    <param name= "GDV" ></param > Public    static void SetFilter (DevExpress.XtraGrid.Views.Grid.GridView gdv)    {      GDV. Optionsview.showautofilterrow = true;      Gdv. Optionsfilter.allowmultiselectincheckedfilterpopup = true;      foreach (DevExpress.XtraGrid.Columns.GridColumn item in GDV. Columns)      {        item. Optionsfilter.autofiltercondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains;  The filter condition is set to include         item. Optionsfilter.filterpopupmode = filterpopupmode.checkedlist;//is set to filter can be multi-select      }    }

Called in the form that you want to query:

SetFilter( gridView2 );

Here are the following:

Thanks again for the enthusiastic [not small width]!!! Struggle

Method 2:

private void Gridview1_customdrawrowindicator (object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)    {      foreach ( DevExpress.XtraGrid.Columns.GridColumn item in Gridview1.columns)      {        item. Optionsfilter.autofiltercondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains;  Filter condition set to include       }    }
Related Article

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.