Filter API

 
Product Name Category Unit Price Units in Stock Quantity per Unit Discontinued
ChaiBeverages$18.003910 boxes x 20 bags
ChangBeverages$19.001724 - 12 oz bottles
Aniseed SyrupCondiments$10.001312 - 550 ml bottles
Chef Anton's Cajun SeasoningCondiments$22.005348 - 6 oz jars
Chef Anton's Gumbo MixCondiments$21.00036 boxes
Grandma's Boysenberry SpreadCondiments$25.0012012 - 8 oz jars
Uncle Bob's Organic Dried PearsProduce$30.001512 - 1 lb pkgs.
Northwoods Cranberry SauceCondiments$40.00612 - 12 oz jars
Mishi Kobe NikuMeat/Poultry$97.002918 - 500 g pkgs.
IkuraSeafood$31.003112 - 200 ml jars
Queso CabralesDairy Products$21.00221 kg pkg.
Queso Manchego La PastoraDairy Products$38.008610 - 500 g pkgs.
KonbuSeafood$6.00242 kg box
TofuProduce$23.003540 - 100 g pkgs.
Genen ShouyuCondiments$16.003924 - 250 ml bottles
Data grid with 77 rows and 6 columns
0 rows are selected
of 6

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.