How to add row number to kendo ui grid?

前端 未结 8 1379
花落未央
花落未央 2020-12-15 09:35

I have a kendo ui grid in my page that has some columns. Now I want to add a column to it that shows me row number. How to I do this? Thanks.

8条回答
  •  独厮守ぢ
    2020-12-15 10:00

    For Razor you also need to actually show the number also: (not enough point thingies to comment)

    above the grid:

    @{int counter = 1;}
    

    inside column definitions:

    columns.Template(@ 
            @counter @{ counter++; }
            ).Title("#");
    

提交回复
热议问题