Filter API

 
Product Name Category Unit Price Units In Stock Quantity Per Unit Discontinued
Chai Beverages $18.00 39 10 boxes x 20 bags
Chang Beverages $19.00 17 24 - 12 oz bottles
Aniseed Syrup Condiments $10.00 13 12 - 550 ml bottles
Chef Anton's Cajun Seasoning Condiments $22.00 53 48 - 6 oz jars
Chef Anton's Gumbo Mix Condiments $21.00 0 36 boxes
Grandma's Boysenberry Spread Condiments $25.00 120 12 - 8 oz jars
Uncle Bob's Organic Dried Pears Produce $30.00 15 12 - 1 lb pkgs.
Northwoods Cranberry Sauce Condiments $40.00 6 12 - 12 oz jars
Mishi Kobe Niku Meat/Poultry $97.00 29 18 - 500 g pkgs.
Ikura Seafood $31.00 31 12 - 200 ml jars
of 8

The DevExpress Blazor Grid allows you to filter data in code.

To apply filter criteria, create a criteria operator object that specifies a filter expression and send this object to the SetFilterCriteria method. When you call this method, the Grid clears all filters applied previously.

You can apply a filter to a column without resetting an existing filter. Pass a criteria operator object to the SetFieldFilterCriteria method to apply the filter to a particular data field. This method uses the AND operator to combine filters for different columns. These methods allow you to filter Grid data against every data source field, including fields not displayed within the Grid.

When a filter is applied, the Grid raises the FilterCriteriaChanged event.

You can use the following methods to get currently applied filters:

In this demo, we create a criteria operator object based on the current value of the tag box. The SetFieldFilterCriteria method is called to apply the criteria operator to the CategoryId column.

For more information, refer to the following topic: Filter API.