Unknown Method DataSource

2 posts, 0 answers
  1. Steve
    Steve avatar
    17 posts
    Member since:
    Oct 2014

    Posted 20 Mar 2015 Link to this post

    Hi All,

    I admit that I am new to all of this.   I have a Grid in an cshtml file.   I am trying to pattern off the Northwind example.   I have the following code within a <div> section:

      @(Html.Kendo().Grid<CompanyViewModel>
        ()
        .Name("companies")
        .HtmlAttributes(new { style="height: 100%; border: 0;"})
        .Scrollable()
        .Columns(columns =>
                  {
                    columns.Template(t => { })
                        .ClientTemplate("#=CompanyId#")
                        .Title("Company ID")
                        .Width(120);
                  }
        )
        .Editable(e => e.Mode(GridEditMode.PopUp))
        .Pageable(pageable => pageable.Refresh(true))
        .Sortable()
        .Selectable()
        .Navigatable()
        .Filterable()
        .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Model(m =>
                    {
                      m.Id(f => f.CompanyId);
                      m.Field(f => f.CompanyId).Editable(false);
                    }
                    )
                   )   
        )


    The trouble I am having is that I have red lines in the editing on everything from the first dataSource all the way to the end.   When I hover over the start of the error I get the pop up description:  C#: Unknown method 'DataSource(?)' of 'Kendo.Mvc.UI.Fluent.....

    Attached is a screen shot.

    I'm lost... any/all help would be great because I'm stuck

    Thanks,
       Steve


  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 24 Mar 2015 Link to this post

    Hello Steve,

    I'm afraid it is not clear what may be causing the described issue on your end judging from the provided information. I suspect it is a project configuration issue, thus you should verify you have correctly setup your project. If you continue to experience difficulties please provide small sample project which exhibits the issue in question.

    Regards,
    Rosen
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top