O'Reilly logo

Learning Kendo UI Web Development by John Adams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Driving the ListView with Web API

Similar to the Grid widget, the ListView widget is able to utilize the [DataSourceRequest] attribute to help drive special functionality for its operations. In this case, we will not simply be querying the data from the server, but also editing it with the Web API.

Create an action method for our ListView example in the KendoController class, as shown here:

private MoviesContext db = new MoviesContext();

public ActionResult ListView()
{
  return View(db.Movies);
}

Then add a view for this action method and add the following HTML markup inside:

@using Kendo.Mvc.UI; @model IEnumerable<Chapter11.Models.Movie> @{ ViewBag.Title = "ListView"; } <script type="text/x-kendo-tmpl" id="template"> <div class="movie-view"> <dl> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required