English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
As shown in the figure above, if you want to search for supplier names including companies with machinery, the normal setting is not allowed, you can only start filtering from the beginning:
method1:
The following is a perfect solution sent to me by a netizen named [Not Xiao Kuan], I am posting it here for everyone to learn together:
/// <summary> /// Set girid to perform a fuzzy search for each column /// </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; //Set the filter condition to include item.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;//Set to filter can be selected multiple times } }
Call in the form to be queried:
SetFilter( gridView2 );
Here is the effect diagram:
Once again, thank you to the warm-hearted [Not Xiao Kuan]!!! Strive
method2:
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; //Set the filter condition to include } }
That's all for the content, I hope everyone will pay more attention to the Yelling Tutorial in the future.