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.v24.2.dll

Declaration

[ToolboxBitmap(typeof(ResFinder), "Bitmaps256.ODataServerModeSource.bmp")]
public class ODataServerModeSource :
    Component,
    IListSource,
    ISupportInitialize,
    IODataServerModeFrontEndOwner,
    IDXCloneable,
    IXtraSourceError

Remarks

The ODataServerModeSource component implements the IListSource interface, and can be used as a data source for a control supporting the server mode.

Note

ODataServerModeSource is a read-only data source.

Server Mode

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.

Code Sample

Use ODataServerModeSource to bind a server-mode enabled control to the OData service using OData Client for .NET, as follows:

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

Note

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.

One-Click Solution for CRUD Web API Services with Role-Based Access Control Using EF Core and XPO

If you target .NET for your backend API, be sure to check out our free Web API Service and register your FREE copy today. The Solution Wizard scaffolds an OData v4 Web API Service (.NET 6+) with integrated authorization & CRUD operations powered by EF Core and our XPO ORM library. You can use OAuth2, JWT or custom authentication strategies alongside tools like Postman or Swagger (OpenAPI) for API testing.

Among its numerous capabilities, our built-in Web API Service filters out secured server data based on permissions granted to users. Advanced/enterprise functions include audit trail, endpoints to download reports, file attachments, check validation, obtain localized captions, etc.

To use the free Solution Wizard (which creates the Web API Service) run the Universal Component Installer from the DevExpress Download Manager.

Inheritance

See Also