Skip to main content

Filtering in Code

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”:

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