BootstrapGridViewBuilderBase<T>.BindToLINQ(IQueryable) Method

Binds the Grid View to a queryable data source on the server mode.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.1.dll

Syntax

public T BindToLINQ(IQueryable query)

Parameters

Type Name Description
IQueryable query

An IQueryable object that specifies the query request to the data service.

Returns

Type Description
T

A reference to this instance after the operation is completed.

The Grid View control supports data binding in server mode, which is designed to work with large datasets. Using this binding mode, the data-aware operations (sorting, filtering, grouping, etc.) are performed on the data server. This technique significantly improves the Grid View's speed and responsiveness.

The BindToLINQ method is used to establish server-mode data binding using the Entity Framework (EF) Core ORM. The following code demonstrates the described functionality in detail.

@model IQueryable<Email>

@(Html.DevExpress()
    .BootstrapGridView<Email>("grid")
    .KeyFieldName(k => k.ID)
    .Columns(columns => {
        columns.Add(c => c.From);
        ...
    })
    .Routes(routes => routes
        .MapRoute(r => r.Action("Binding").Controller("GridView")))
    .BindToLINQ(Model)

See also the Binding to Large Database using EF Core online demo.