标签:style blog http color os strong art cti
Example 1:
下面的代码示例,展示了如何过滤开头字母为F的海运国家。利用ColumnFilterInfo 对象创建所需的过滤器。然后,为其分配GridColumn.FilterInfo属性。
C#
1 using DevExpress.XtraGrid.Columns; 2 gridView1.Columns["ShipCountry"].FilterInfo = 3 new ColumnFilterInfo("[ShipCountry] LIKE ‘F%‘");
Example 2
下面的示例展示了如何通过ColumnView.ActiveFilter对象添加过滤条件。过滤条件选择过滤以C字母开头的 CategoryName 字段。
C#
1 using DevExpress.XtraGrid.Views.Base; 2 using DevExpress.XtraGrid.Columns; 3 //... 4 ColumnView view = gridView1; 5 view.ActiveFilter.Add(view.Columns["CategoryName"], 6 new ColumnFilterInfo("[CategoryName] Like ‘c%‘", ""));
Example 3
下面的示例展示了如何通过ColumnView.ActiveFilter对象添加过滤条件。该示例选择CategoryName列中 "Produce" 或者 "Seafood" 值作为过滤条件;
C#
using DevExpress.XtraGrid.Views.Base; using DevExpress.XtraGrid.Columns; //... ColumnView view = gridView1; ViewColumnFilterInfo viewFilterInfo = new ViewColumnFilterInfo(view.Columns["CategoryName"], new ColumnFilterInfo("[CategoryName] = ‘Produce‘ OR [CategoryName] = ‘Seafood‘", "")); view.ActiveFilter.Add(viewFilterInfo);
DevExpress XtraGrid网格控件示例七:列过滤,布布扣,bubuko.com
DevExpress XtraGrid网格控件示例七:列过滤
标签:style blog http color os strong art cti
原文地址:http://www.cnblogs.com/lwaixd/p/3883784.html