Skip to content

Commit

Permalink
DataGrid: update Server-Side Filtering topic (#5660) (#5661)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaskorohodova authored Oct 10, 2023
1 parent a4bdd1a commit 1437a79
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@ The following code example demonstrates how to bind the DataGrid to the [OData s

You need to specify the [calculateFilterExpression](/api-reference/_hidden/GridBaseColumn/calculateFilterExpression.md '/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/#calculateFilterExpression') property and pass the `"Products/any(o: substringof("filterValue",o/ProductName) eq true)"` expression to the [EdmLiteral](/api-reference/30%20Data%20Layer/EdmLiteral '/Documentation/ApiReference/Data_Layer/EdmLiteral/') method. In addition, you need to handle the [calculateCellValue](/api-reference/_hidden/GridBaseColumn/calculateCellValue.md '/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/#calculateCellValue') property and create a comma-separated string from ProductNames. This string will be displayed in column cells.

For the [DevExtreme.AspNet.Data](https://github.com/DevExpress/DevExtreme.AspNet.Data) library, you can implement a custom filter expression compiler and pass it to the [BinaryExpressionCompiler](https://devexpress.github.io/DevExtreme.AspNet.Data/net/api/DevExtreme.AspNet.Data.Helpers.CustomFilterCompilers.html#DevExtreme_AspNet_Data_Helpers_CustomFilterCompilers_RegisterBinaryExpressionCompiler_System_Func_DevExtreme_AspNet_Data_Helpers_IBinaryExpressionInfo_System_Linq_Expressions_Expression__) method. This method should be called before `DataSourcerLoader.Load` in the Controller.

The DataGrid sends a filter expression to the backend and expects relevant data as a result. The solution for filtering depends on the backend type. However, a common requirement is that the backend should implement the corresponding filtering operation.

0 comments on commit 1437a79

Please sign in to comment.