New to Kendo UI for jQuery? Download free 30-day trial

How to Show Index in Kendo UI ListView


Product Version
Kendo UI ListView 2023.3.1114


I want to show the index of an item when editing in the Kendo UI ListView.


To display the index of an item in the Kendo UI ListView, you can create a template function within the editTemplate that returns the index from the ListView's dataSource. Here is an example:

<div class="product-view k-widget">
    <!-- Rest of the template -->
  <!-- Edit buttons -->
function getIndex(data){
  //Get ListView
  var listView = $("#listView").data("kendoListView");

  //Get its DataSource
  var lvDataSource = listView.dataSource;

  //Return Index
  return "Index: " + lvDataSource.indexOf(data);

The following Progress Kendo UI Dojo demonstrates the above steps in action.

In this article