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

Defines the fluent interface for configuring grid noRecords option.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridNoRecordsSettingsBuilder

Inheritance: objectGridNoRecordsSettingsBuilder

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 GridNoRecordsSettingsBuilder class.

C#
public GridNoRecordsSettingsBuilder(GridNoRecordsSettings settings)
Parameters:settingsGridNoRecordsSettings

The settings.

Methods

The template used for noRecords option.

C#
public GridNoRecordsSettingsBuilder Template(string template)
Parameters:templatestring

The template which is rendered when current view contains no records.

Returns:

GridNoRecordsSettingsBuilder

Example:
C#
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.NoRecords(n => n.Template("No data available on current page. Current page is: #=this.dataSource.page()#"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
)
)

The name of the JavaScript function that returns the template used for noRecords option.

C#
public GridNoRecordsSettingsBuilder TemplateHandler(string template)
Parameters:templatestringReturns:

GridNoRecordsSettingsBuilder

The Id of the template used for noRecords option.

C#
public GridNoRecordsSettingsBuilder TemplateId(string templateId)
Parameters:templateIdstring

The template which is rendered when current view contains no records.

Returns:

GridNoRecordsSettingsBuilder

Example:
C#
<script id="noRecordsTemplate" type="text/x-kendo-template">
external HTML template, not centered
</script>
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.NoRecords(n => n.TemplateId("noRecordsTemplate"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
)
)

The Id of the template used for noRecords option.

C#
public GridNoRecordsSettingsBuilder TemplateView(MvcHtmlString template)
Parameters:templateMvcHtmlStringReturns:

GridNoRecordsSettingsBuilder

Example:
C#
<script id="noRecordsTemplate" type="text/x-kendo-template">
external HTML template, not centered
</script>
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.NoRecords(n => n.TemplateView(Html.Partial("noRecordsTemplate")))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
)
)