OData Server Operations

You can sort, filter, or paginate the data to which the Grid is bound by using the OData service.

To apply the data operations on the server, process the parameters by utilizing the toODataString function which is part of the Data Query package.

To use toODataString, configure the KendoReact Grid to use DataState and the onDataStateChange event. The DataState returned by the onDataStateChange event will contain information about the current page, the filter and sort expressions, grouping and aggregates. To make the request, use the toODataString helper method with the current DataState in order to create OData query string.

The following example demonstrates how to request and process data by handling the onDataStateChange event. In addition, the sample also shows how to:

  • Separate the data request and response logic from the declaration of the Grid.
  • Debounce the event to avoid multiple requests at the same time.
  • Show a loading panel over the Grid during data fetching.
View Source
Change Theme:

Note that the toODataString helper method does not support grouping. To add grouping information in the query, you can use the generated query string and manually include the grouping information by using the group descriptors within the DataState.

In this article

Not finding the help you need?