Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Data Source Expressions

Filter
  • And
    • PriceIs less than
      $500000
Apply
Clear

The currently composed filter expression: ([Price] < 500000)
FirstPrevPage 1 of 4NextLastAll
328 S Kerema Ave, Milford, CT 06465
Price: $350,000.00
House Size: 8356
YearBuilt: 2010
Beds: 4
Baths: 2
5119 Beryl Dr, San Antonio, TX 78212
Price: $455,000.00
House Size: 7980
YearBuilt: 2007
Beds: 4
Baths: 2
8512 Tanglewood Cir, Reform, AL 35487
Price: $250,000.00
House Size: 5600
YearBuilt: 2011
Beds: 3
Baths: 2
1198 Theresa Cir, Whitinsville, MA 01582
Price: $320,000.00
House Size: 4990
YearBuilt: 2011
Beds: 4
Baths: 3
FirstPrevPage 1 of 4NextLastAll

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

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

In this demo, a standalone ASPxFilterControl is used to compose MS Sql-specific filter criteria. These criteria are applied to data that is obtained from an object using an ObjectDataSource, and displayed by an ASPxDataView control

The text of the filter expression being composed is displayed by a label below 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 expression, generates filter criteria by the GetFilterExpressionForDataSet method call, and applies a filter expression to the data source control's FilterExpression property.