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 } }