码迷,mamicode.com
首页 > 其他好文 > 详细

GridControl的模糊查询

时间:2016-07-10 13:51:43      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:

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

GridControl的模糊查询

标签:

原文地址:http://www.cnblogs.com/lanyubaicl/p/5657495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!