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

Unknown Method DataSource

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 21 Mar 2015, 02:33 AM
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


1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 24 Mar 2015, 04:26 PM
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.

 
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or