Error while learning ListView

2 posts, 1 answers
  1. Jarrett
    Jarrett avatar
    1 posts
    Member since:
    May 2017

    Posted 15 May Link to this post

    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.

     

  2. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1966 posts

    Posted 17 May Link to this post

    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.
Back to Top