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

GridNoRecordsSettingsBuilder

Defines the fluent interface for configuring grid noRecords option.

Methods

Template(System.String)

The template used for noRecords option.

Parameters

template - System.String

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

Example


            @(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)
                )
            )

TemplateId(System.String)

The Id of the template used for noRecords option.

Parameters

templateId - System.String

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

Example


             <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)
                )
            )

In this article
Not finding the help you need?