程序实现DataGrid过滤设置

给gdv_pro.ActiveFilterString赋值就能直接控制DataGrid过滤

gdv_pro.ActiveFilterString语法:

最简单方式:gdv_pro.ActiveFilterString =" [列名] = '值' ";

或: gdv_pro.ActiveFilterString =" [列名] in ('值1','值2','值3') ";

或 gdv_pro.ActiveFilterString =" [列名] =1 And/Or [列名] =2 ";

清除过滤条件用:gdv_pro.ActiveFilter.Clear();

更多参考:https://documentation.devexpress.com/WindowsForms/2567/Controls-and-Libraries/Data-Grid/Filter-and-Search/Filtering-in-Code

 

此外,可设置ShowFilterPanelMode=Never;禁用控件底端出现的过滤条件显示面板

posted on 2017-12-04 21:56  mol1995  阅读(444)  评论(0编辑  收藏  举报

导航