Skip to main content

ODataServerModeSource Class

The data source for the GridControl and SearchLookUpEdit controls that binds these controls to OData service in Server Mode.

Namespace: DevExpress.Data.ODataLinq

Assembly: DevExpress.Data.v22.2.dll

NuGet Package: DevExpress.Data


[ToolboxBitmap(typeof(ResFinder), "Bitmaps256.ODataServerModeSource.bmp")]
public class ODataServerModeSource :


Server mode allows a data-aware control to rapidly work with large datasets. Loading records in small portions on demand and performing data-aware operations on the data server side are the key features of server mode. When the control needs to display a specific portion of data, it calls a specific method of the bound server mode data source. This method sends a corresponding request to the data store, and upon receiving the results, passes them back to the control. The ODataServerModeSource component implements the IListSource interface, and can be used as a data source for a control supporting the server mode feature.

Use ODataServerModeSource to bind a server-mode enabled control to the ODate service using OData Client for .NET. Specify the type of objects contained in the query result using the ODataServerModeSource.ElementType property. Specify the required query request to an OData service via the ODataServerModeSource.Query property. Bind the control to the ODataServerModeSource component.

public MainWindow() {
    grid.DataSource = new ODataServerModeSource() {        
        KeyExpression = "CustomerID",
        Query = myDataServiceContext.Customers


ODataServerModeSource is a read-only data source.


A BadRequestException that occurs when data is being sorted, counted, etc., may be caused by the breaking change in Web API OData V6.0.0. For details, refer to the Global Query Setting section in the OData Web API documentation.


See Also