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

LINQ Server Mode

  • 2 minutes to read

The server mode can be enabled for any Language-Integrated Query (LINQ) provider. When an end-user performs data operations - sorting, grouping, etc., the LINQ Server Mode Source analyzes the grid’s current state, and generates smart queries to receive only those records that must be displayed on-screen. These requests are passed to the associated LINQ Provider. The LINQ Provider translates them into required queries, and executes them.

Creating Data Classes

  • Add ‘LINQ to SQL Classes’.

    LinqServerMode_AddNewItem

  • Data classes can then be created and edited in the Object Relational Designer (O/R Designer). The O/R Designer provides a visual design surface for creating LINQ to SQL entity classes, and relationships based on objects in a database.

    Entity classes can be created and mapped to tables and views by dragging database tables and views from Server Explorer/Database Explorer onto the O/R Designer.

    LinqServerMode_CreateEntityClass

  • Save your changes, close the O/R Designer, and rebuild the solution.

Binding to LinqServerModeSource

Create a new instance of the LinqServerModeSource class. Specify the type of objects retrieved from a data source, the key expression and queryable source. Finally, bind the DXGrid control to the LinqServerModeSource component.

<dxg:GridControl x:Name="grid" AutoPopulateColumns="True">
     <dxg:GridControl.View>
        <dxg:TableView AutoWidth="True"/>
    </dxg:GridControl.View>
</dxg:GridControl>