I have the following code :
@(Html.Kendo().Grid<DataMatrixPrinter.ViewModels.Business.ResearcherVM.ResearcherModel>()
.Name("GridKendoResearcherGrid")
.DataSource(
datasource => datasource
.Ajax()
.PageSize(20)
.Read(read => read.Url("/api/ResearcherApi/GetResearchers").Data("AdvSearch"))
)
.Columns(columns =>
{
columns.Bound(c => c.ID).Title("ID");
columns.Bound(c => c.fullName).Title("Name");
})
.Pageable()
.Sortable()
.Selectable()
.Events(events => events.Change("UpdateRecordKendo")))
I want to display the number for each row. So I changed the following command, but the value of this column is empty.
@{
int counter = 1;
}
@(Html.Kendo().Grid<DataMatrixPrinter.ViewModels.Business.ResearcherVM.ResearcherModel>()
.Name("GridKendoResearcherGrid")
.DataSource(
datasource => datasource
.Ajax()
.PageSize(20)
.Read(read => read.Url("/api/ResearcherApi/GetResearchers").Data("AdvSearch"))
)
.Columns(columns =>
{
columns.Template(@<text><span>@(counter++)</span></text>).Title("#");
columns.Bound(c => c.fullName).Title("Name");
})
.Pageable()
.Sortable()
.Selectable()
.Events(events => events.Change("UpdateRecordKendo")))
Why does not the value appear?