Skip to main content
A newer version of this page is available. .

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

Declaration

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

Remarks

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() {
    InitializeComponent();
    grid.DataSource = new ODataServerModeSource() {        
        KeyExpression = "CustomerID",
        Query = myDataServiceContext.Customers
    };
}

Note

ODataServerModeSource is a read-only data source.

Important

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.

Inheritance

See Also