This is a migrated thread and some comments may be shown as answers.

Error while learning ListView

1 Answer 92 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Jarrett
Top achievements
Rank 1
Jarrett asked on 15 May 2017, 06:23 PM

Hello,

I have recently started a project using C# MVC and the related Telerik tools both of which I am very new to.  This  project has a requirement of using the ListView widget.  I've taken the base project that is created when you start a new project and I am attempting to convert it to a ListView. 

I've removed the Grid code and replaced it with the code from the ListView Demo after confirming that the project would launch without error.  Below is the code that i have in the index.cshtml file.

<div class="row">
<div class="col-xs-18 col-md-12">
        @(Html.Kendo().ListView<Landing.Models.OrderViewModel>()
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("template")
    .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Orders_Read", "ListView"))
            .PageSize(10)
            )
            .Pageable(pageable => pageable
           .Refresh(true)
           .ButtonCount(5)
           .PageSizes(new[] { 5, 15, 21 })
        )
        )
</div>
</div>

 

I have made a few minor changes but have come across these two issues with running the project.  If I run the project without the debugger no data shows when IE launches.  If I run the project using the IIS Express button in VS2017 I receive the attached error.  I am thinking that I am making a new to the technology mistake but I am uncertain as where to start.  A google search has not turned up any useful information yet.  Has anyone attempted to complete something similar and overcome this error.

Thank you in advance and please let me know if you need additional information concerning my project.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 17 May 2017, 10:39 AM

Hello,

The problem here seems a missing template definition. Please make sure that a script with id of "template" is defined as shown in the  ListView HtmlHelper Overview tutorial. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListView
Asked by
Jarrett
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or