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

Defines the fluent interface for configuring the DataSource when in read-only mode.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ReadOnlyDataSourceBuilder

Inheritance: objectReadOnlyDataSourceBuilder

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

Constructors

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

Methods

Configures whether diacritic filtering should be used.

C#
public virtual ReadOnlyDataSourceBuilder AccentFoldingFiltering(string culture)
Parameters:culturestringReturns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=> ds
.AccentFoldingFiltering("de-DE")
)
)

Use it to configure Custom binding.

C#
public ReadOnlyCustomDataSourceBuilder Custom()
Returns:

ReadOnlyCustomDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=> ds
.Custom()
)
)

Configures the client-side events

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

The events configuration.

Returns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.Events(ev=&gt;ev.Sync("onSync"))
)
)

Configures the URL for Read operation.

C#
public ReadOnlyDataSourceBuilder Read(Action<CrudOperationBuilder> configurator)
Parameters:configuratorAction<CrudOperationBuilder>Returns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.Read(r=&gt;r.Action("Action", "Controller"))
)
)

Sets controller and action for Read operation.

C#
public ReadOnlyDataSourceBuilder Read(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

Action name

controllerNamestring

Controller Name

routeValuesobject

Route values

Returns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.Read("Action", "Controller", new { })
)
)

Sets controller, action and routeValues for Read operation.

C#
public ReadOnlyDataSourceBuilder Read(string actionName, string controllerName)
Parameters:actionNamestring

Action name

controllerNamestring

Controller Name

Returns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.Read("Action", "Controller")
)
)

Specifies if filtering should be handled by the server.

C#
public ReadOnlyDataSourceBuilder ServerFiltering()
Returns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.ServerFiltering()
)
)

Specifies if filtering should be handled by the server.

C#
public ReadOnlyDataSourceBuilder ServerFiltering(bool enabled)
Parameters:enabledboolReturns:

ReadOnlyDataSourceBuilder

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.ServerFiltering(false)
)
)
C#
protected virtual void SetOperationUrl(CrudOperation operation, string actionName, string controllerName, object routeValues)
Parameters:operationCrudOperationactionNamestringcontrollerNamestringrouteValuesobject

Use it to configure SignalR binding.

C#
public SignalRDataSourceBuilder<object> SignalR()
Returns:

SignalRDataSourceBuilder<object>

Example:
C#
@(Html.Kendo().DropDownList()
.Name("ddl")
.DataSource(ds=&gt; ds
.SignalR()
)
)