New to Telerik UI for ASP.NET Core? 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

Initializes a new instance of the ReadOnlyDataSourceBuilder class.

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

The DataSource instance

viewContextViewContext

The view context

urlGeneratorIUrlGenerator

A url generator instance

Methods

Use it to configure SignalR binding.

C#
public ReadOnlyAjaxDataSourceBuilder<object> Ajax()
Returns:

ReadOnlyAjaxDataSourceBuilder<object>

A ReadOnlyDataSourceBuilder instance for method chaining.

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

Use it to configure Custom binding.

C#
public ReadOnlyCustomDataSourceBuilder Custom()
Returns:

ReadOnlyCustomDataSourceBuilder

A ReadOnlyDataSourceBuilder instance for method chaining.

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

Configures the client-side events

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

The events configuration.

Returns:

ReadOnlyDataSourceBuilder

A ReadOnlyDataSourceBuilder instance for method chaining.

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

A ReadOnlyDataSourceBuilder instance for method chaining.

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

A ReadOnlyDataSourceBuilder instance for method chaining.

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

A ReadOnlyDataSourceBuilder instance for method chaining.

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

A ReadOnlyDataSourceBuilder instance for method chaining.

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

A ReadOnlyDataSourceBuilder instance for method chaining.

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

SetOperationUrl method.

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>

A ReadOnlyDataSourceBuilder instance for method chaining.

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