For me it worked like this
grid = $("#grid").kendoGrid({
dataSource: dataSource,
height: 543,
scrollable: {
virtual: true
},
pageable: {
numeric: false,
previousNext: false,
messages: {
display: "Showing {2} data items"
}
},
columns: [
{
title: "#",
// template: "#= ++record #",
template: function(dataItem) {
var rowNumber = 0
if($("#grid").data("kendoGrid")) {
rowNumber = $("#grid").data("kendoGrid").dataSource.indexOf(dataItem) + 1;
}
return "<strong>" + rowNumber + "</strong>";
},
width: 80
},
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" },
{ field: "City", title: "City" },
{ field: "Title" }
]
});`
without using $("#grid").data("kendoGrid") this in first renders it was showing 0 as row number.