Free Trial Buy Now

Filter Control - Data Source Specific Filter Expression

Filter
And
 
CategoryEqualsSports
Apply
Clear
The currently composed filter expression for MS Access:
([Category] = 'SPORTS')
Mercedes-Benz SL500 Roadster
Category: SPORTS
Transmission: 5 Speed automatic
Price: $83800
Mercedes-Benz CLK55 AMG Cabriolet
Category: SPORTS
Transmission: 5 Speed automatic
Price: $79645
Mercedes-Benz C230 Kompressor Sport Coupe
Category: SPORTS
Transmission: 5 Speed automatic
Price: $25600
 

Description

This demo illustrates the ASPxFilterControl's ability to generate database system specific filter expressions. The ASPxFilterControl provides the following methods whose return values can be used as filter expressions ('WHERE' clauses) for the corresponding data source types:

  • GetFilterExpressionForAccess()
  • GetFilterExpressionForOracle()
  • GetFilterExpressionForMsSql()

In addition, the obtained filter expression can be validated for completeness by using the IsFilterExpressionValid method, which is available both on the server and client sides. This method checks whether all expression conditions are filled and indicates whether it's safe to apply the expression.

In this demo, a standalone ASPxFilterControl is used to compose MS Access specific filter criteria. These criteria are applied to data which is obtained from an .MDB file using an AccessDataSource and is displayed by an ASPxDataView control.

The text of the filter expression being composed is displayed by a label to the right of the ASPxFilterControl. If a filter expression is not valid, this is indicated by the corresponding label text.

Clicking the Apply button validates the current filter criteria and applies it to data by assigning it to the data source control's SelectCommand property. Alternatively, you can generate the filter criteria via the GetFilterExpressionForDataSet method call and assign it to the data source control's FilterExpression property.

Version: v2012 vol 2.8
Experience the DevExpress Difference Today
Demos with source code are included with an installation of DevExpress controls for ASP.NET. Refer to the Demos and Sample Applications topic to learn more.
To download your free evaluation copy of our award-winning ASP.NET libraries, visit the Downloads page
All DevExpress ASP.NET Controls ship as part of DXperience ASP.NET, Enterprise, and Universal.
To obtain pricing information, visit the Pricing Options page or contact us via Email at info@devexpress.com
or by telephone at +1 (818) 844-3383 between 8:30am and 5pm Pacific Time.