New to Telerik UI for ASP.NET Core? Download free 30-day trial

FilterableWebApiDataSourceBuilder

Methods

Filter(System.Action)

Configures the initial filter.

Parameters

configurator - System.Action<DataSourceFilterDescriptorFactory>

The filter configuration

Example


                    @(Html.Kendo().Scheduler<Screening>()
                        .Name("scheduler")
                        .DataSource(ds => ds.WebApi().Filter(f=>f.Add(s=>s.Description)))
                    )

Model(System.Action)

Configures Model properties

Parameters

configurator - System.Action<DataSourceSchedulerModelDescriptorFactory>

The model configuration

Example


                    @(Html.Kendo().Scheduler<Screening>()
                        .Name("scheduler")
                        .DataSource(ds => ds.WebApi().Model(f=>f.Id(s=>s.RecurrenceId)))
                    )

Sort(System.Action)

Parameters

configurator - System.Action<DataSourceSortDescriptorFactory>

Group(System.Action)

Parameters

configurator - System.Action<DataSourceGroupDescriptorFactory>

Aggregates(System.Action)

Parameters

aggregates - System.Action<DataSourceAggregateDescriptorFactory>

Update(System.Action)

Configures the URL for Update operation.

Parameters

configurator - System.Action<CrudOperationBuilder>

The Update configurator.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                               x.Update(y=>y.Action("Action", "Controller"));
                           })
               )

Update(System.String)

Sets controller, action and routeValues for Update operation.

Parameters

url - System.String

Absolute or relative URL for the operation

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Update("url");
                           })
               )

Update(System.String,System.String)

Sets controller and action for Update operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Update("Action", "Controller");
                           })
               )

Update(System.String,System.String,System.Object)

Sets controller, action and routeValues for Update operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

routeValues - System.Object

Route values

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Update("Action", "Controller", new { } );
                           })
               )

Create(System.Action)

Configures the URL for Create operation.

Parameters

configurator - System.Action<CrudOperationBuilder>

The Create configurator.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                               x.Create(y=>y.Action("Action", "Controller"));
                           })
               )

Create(System.String)

Sets controller, action and routeValues for Create operation.

Parameters

url - System.String

Absolute or relative URL for the operation

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Create("url");
                           })
               )

Create(System.String,System.String)

Sets controller and action for Create operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Create("Action", "Controller");
                           })
               )

Create(System.String,System.String,System.Object)

Sets controller, action and routeValues for Create operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

routeValues - System.Object

Route values

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Create("Action", "Controller", new { } );
                           })
               )

Destroy(System.Action)

Configures the URL for Destroy operation.

Parameters

configurator - System.Action<CrudOperationBuilder>

The Destroy configurator.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                               x.Destroy(y=>y.Action("Action", "Controller"));
                           })
               )

Destroy(System.String)

Sets controller and action for Destroy operation.

Parameters

url - System.String

Absolute or relative URL for the operation

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Destroy("url");
                           })
               )

Destroy(System.String,System.String)

Sets controller and action for Destroy operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Destroy("Action", "Controller");
                           })
               )

Destroy(System.String,System.String,System.Object)

Sets controller, action and routeValues for Destroy operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

routeValues - System.Object

Route values

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Destroy("Action", "Controller", new { } );
                           })
               )

AutoSync(System.Boolean)

Determines if data source would automatically sync any changes to its data items. By default changes are not automatically sync-ed.

Parameters

enabled - System.Boolean

If true changes will be automatically synced, otherwise false.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.AutoSync(true);
                           })
               )

Batch(System.Boolean)

Determines if modifications will be sent to the server in batches or as individually requests.

Parameters

enabled - System.Boolean

If true changes will be batched, otherwise false.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Batch(true);
                           })
               )

GroupPaging(System.Boolean)

Enables/disables group paging.

Parameters

enabled - System.Boolean

If true group paging is enabled, otherwise not.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.GroupPaging(true);
                           })
               )

Events(System.Action)

Configures the client-side events

Parameters

configurator - System.Action<DataSourceEventBuilder>

Read(System.Action)

Configures the URL for Read operation.

Parameters

configurator - System.Action<CrudOperationBuilder>

The read configuration.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                 x.Read(r=>r.Action("Action", "Controller"));
                           })
               )

Read(System.String)

Sets controller and action for Read operation.

Parameters

url - System.String

Absolute or relative URL for the operation

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Read("url");
                           })
               )

Read(System.String,System.String,System.Object)

Sets controller and action for Read operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

routeValues - System.Object

Route values

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Read("Action", "Controller", new { });
                           })
               )

Read(System.String,System.String)

Sets controller, action and routeValues for Read operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Read("Action", "Controller");
                           })
               )

Total(System.Int32)

Sets the total number of records in the data source. Required during Custom binding.

Parameters

total - System.Int32

Number of records

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Total(10);
                           })
               )

PageSize(System.Int32)

Sets the number of records displayed on a single page.

Parameters

pageSize - System.Int32

The count of records per page.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.PageSize(10);
                           })
               )

OfflineStorage(System.String)

Sets the key used for offline state persistance.

Parameters

key - System.String

The offline storage key name.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.OfflineStorage("key");
                           })
               )

AccentFoldingFiltering(System.String)

Configures whether diacritic filtering should be used.

Parameters

culture - System.String

The used culture.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.AccentFoldingFiltering("de-DE");
                           })
               )

OfflineStorage(System.String,System.String)

Specifies custom implementation for offline storage.

Parameters

getItem - System.String

The name of the JavaScript function which returns the offline state.

setItem - System.String

The name of the JavaScript function which saves the offline state.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.OfflineStorage("Get", "Set");
                           })
               )

Culture(System.String)

Configures what culture.

Parameters

culture - System.String

The used culture.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                                x.Culture("de-DE");
                           })
               )

ServerOperation(System.Boolean)

Sets the operation mode of the DataSource. By default the DataSource will make a request to the server when data for paging, sorting, filtering or grouping is needed. If set to false all data will be requested through single request. Any other paging, sorting, filtering or grouping will be performed client-side.

Parameters

enabled - System.Boolean

True(default) if server operation mode is enabled, otherwise false.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                               x.ServerOperation(true);
                           })
               )

Model(System.Action)

Configures Model properties

Parameters

configurator - System.Action<DataSourceModelDescriptorFactory>

The Model configurator.

Example


               @(Html.Kendo().DataSource<OrderViewModel>()
                           .Name("ds")
                           .WebApi(x=> {
                               x.Model(m => m.Id(id => id.OrderID));
                           })
               )

CaseSensitiveFiltering()

When enabled filtering is case sensitive

Example


            .DataSource(dataSource => dataSource
                .WebApi()
                .CaseSensitiveFiltering()
            )

Schema(System.Action)

Configures the WebApi schema

Parameters

configurator - System.Action<WebApiDataSourceSchemaBuilder>
In this article
Not finding the help you need?