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

GridNoRecordsSettingsBuilder

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

TemplateView(System.Web.Mvc.MvcHtmlString)

The Id of the template used for noRecords option.

Parameters

template - System.Web.Mvc.MvcHtmlString

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.TemplateView(Html.Partial("noRecordsTemplate")))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                )
            )

TemplateHandler(System.String)

Parameters

template - System.String
In this article
Not finding the help you need?