标签:
/// <summary> /// 设置girid为每一列都模糊搜索 /// </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; //筛选条件设置为包含 item.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;//设置为过滤是可以多选 } }
调用代码:
SetFilter( gridView2 );
或者
方法二、
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; //筛选条件设置为包含 } }
原文地址:http://blog.csdn.net/zhaozhimao/article/details/50273535
标签:
原文地址:http://www.cnblogs.com/lanyubaicl/p/5657495.html