Back to Devexpress

Filtering in Code

aspnetmvc-120473-components-grid-view-data-shaping-and-manipulation-filtering-filtering-in-code.md

latest1.2 KB
Original Source

Filtering in Code

  • Feb 02, 2023

The DevExpress ASP.NET MVC Grid View extension allows you to filter its data programmatically using one of the following methods:

Example

The following code illustrates how to filter grid records by Country “USA” and Unit Price greater than “250”:

cshtml
@Html.DevExpress().GridView(settings => {
    settings.Name = "gridView";
    settings.FilterExpression="[Country] = 'USA' AND [UnitPrice] > 250";
...
}).Bind(Model).GetHtml()

See Also

Criteria Language Syntax