New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Provides a base class for custom data source builders with common configuration options.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TCustomDataSourceBuilder

The type of the custom data source builder.

Syntax:

C#
public abstract class CustomDataSourceBuilderBase<TCustomDataSourceBuilder> where TCustomDataSourceBuilder : CustomDataSourceBuilderBase<TCustomDataSourceBuilder>

Inheritance: objectCustomDataSourceBuilderBase<TCustomDataSourceBuilder>

Derived Classes: CustomDataSourceBuilder<TModel>CustomFileManagerDataSourceBuilderCustomHierarchicalDataSourceBuilderReadOnlyCustomDataSourceBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public CustomDataSourceBuilderBase(DataSource dataSource, ViewContext viewContext, IUrlGenerator urlGenerator)
Parameters:dataSourceDataSourceviewContextViewContexturlGeneratorIUrlGenerator

Fields

C#
protected readonly DataSource dataSource
C#
protected readonly IUrlGenerator urlGenerator

viewContext

ViewContext

C#
protected readonly ViewContext viewContext

Methods

Configures whether diacritic filtering should be used.

C#
public TCustomDataSourceBuilder AccentFoldingFiltering(string culture)
Parameters:culturestring

The culture applied for the Action

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.AccentFoldingFiltering("bg-BG")
)

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

C#
public virtual TCustomDataSourceBuilder AutoSync(bool enabled)
Parameters:enabledbool

If true changes will be automatically synced, otherwise false.

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.AutoSync(true)
)

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

C#
public virtual TCustomDataSourceBuilder Batch(bool enabled)
Parameters:enabledbool

If true changes will be batched, otherwise false.

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.Batch(true)
)

Configures the client-side events

C#
public TCustomDataSourceBuilder Events(Action<DataSourceEventBuilder> configurator)
Parameters:configuratorAction<DataSourceEventBuilder>

The lambda which configures the Update Action

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.Events(e =&gt; e.Push("onDataSourcePush"))
)

Determines if group paging is enabled.

C#
public virtual TCustomDataSourceBuilder GroupPaging(bool enabled)
Parameters:enabledbool

If true, group paging is enabled.

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.GroupPaging(true)
)

Sets the page of the DataSource.

C#
public TCustomDataSourceBuilder Page(int page)
Parameters:pageint

Sets the page value

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.Page(3)
)

Sets the number of records displayed on a single page.

C#
public TCustomDataSourceBuilder PageSize(int pageSize)
Parameters:pageSizeint

An integer value for the size of a Page in the Custom DataSource

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.PageSize(20)
)

Enables or disables server aggregates. If enabled the data source will expect the aggregates to be calculated server-side.

C#
public TCustomDataSourceBuilder ServerAggregates(bool enabled)
Parameters:enabledbool

True to enable server aggregates; otherwise false (the default).

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.ServerAggregates(false)
)

Enables or disables server filtering mode. If enabled the data source will make a request during filtering.

C#
public TCustomDataSourceBuilder ServerFiltering(bool enabled)
Parameters:enabledbool

True to enable server filtering; otherwise false (the default).

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.ServerFiltering(false)
)

Enables or disables server grouping mode. If enabled the data source will make a request during grouping.

C#
public TCustomDataSourceBuilder ServerGrouping(bool enabled)
Parameters:enabledbool

True to enable server grouping; otherwise false (the default).

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.ServerGrouping(false)
)

Enables or disables server paging mode. If enabled the data source will make a request during paging.

C#
public TCustomDataSourceBuilder ServerPaging(bool enabled)
Parameters:enabledbool

True to enable server paging; otherwise false (the default).

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.ServerPaging(false)
)

Enables or disables server sorting mode. If enabled the data source will make a request during paging.

C#
public TCustomDataSourceBuilder ServerSorting(bool enabled)
Parameters:enabledbool

True to enable server sorting; otherwise false (the default).

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.ServerSorting(false)
)

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

C#
public TCustomDataSourceBuilder Total(int total)
Parameters:totalint

Number of records

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.Total(50)
)

Sets the transport of the DataSource using anonymous object.

C#
public TCustomDataSourceBuilder Transport(object settings)
Parameters:settingsobjectReturns:

TCustomDataSourceBuilder

Sets the type of the data source.

C#
public TCustomDataSourceBuilder Type(string type)
Parameters:typestring

If set, the data source will use a predefined transport and/or schema.

Returns:

TCustomDataSourceBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Custom()
.Type("odata")
)