Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

No data displayed

$
0
0

I have adapted the code from the example, but no data displayed.

Viewcode:

01.@(Html.Kendo().MobileView()
02.        .Title("EntityFramework DataAccess")
03.    .Name("Index")
04.    .Content(@<text>
05. 
06.        @(Html.Kendo().Grid<vEF_Library.Address>()
07.      .Name("grid")
08.      .DataSource(dataSource => dataSource // Configure the grid data source
09.          .Ajax() // Specify that ajax binding is used
10.          .Read(read => read.Action("Products_Read", "Home")) // Set the action method which will return the data in JSON format
11.       )
12.      .Columns(columns =>
13.      {
14.          // Create a column bound to the ProductID property
15.          columns.Bound(address => address.LastName);
16.          // Create a column bound to the ProductName property
17.          columns.Bound(address => address.FirstName);
18.          // Create a column bound to the UnitsInStock property
19.          columns.Bound(address => address.Phone);
20.      })
21.      .Pageable() // Enable paging
22.      .Sortable() // Enable sorting
23.        )
24.    </text>)
25.)

 Controllercode:

01.namespacevEF_AspApplication.Controllers
02.{
03.    publicclassHomeController : Controller
04.    {
05.        publicActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
06.        {
07.            using(var db = newvEF_Library.MyDataModelContext())
08.            {
09.                IQueryable<Address> products = db.Addresses;
10.                DataSourceResult result = products.ToDataSourceResult(request);          
11.                returnJson(result);
12.            }
13.        }
14.    }
15.}

Results, see attached screenshots.

 

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>